Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Creating A Class

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Creating A Class

    I understand how to create a class, I am just confused about the type attributes. Can anyone assist me with this?


    Write class Computer with attributes brand, type, price. The type attribute is an enumerated type variable with values DESKTOP, LAPTOP, and TABLET. Adhere to our Java coding standards. Computer has an additional method, calculateCharge, that accepts the quantity sold and returns the total charge.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Creating A Class

    Recommended reading: Enum Types (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. [SOLVED] Class Creating Help
    By pitchblack in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 1st, 2011, 11:25 PM
  2. Creating a scaleUp main method in a new class
    By Brainz in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 16th, 2010, 08:58 AM
  3. Help with creating a class
    By cdawg_2010 in forum Loops & Control Statements
    Replies: 4
    Last Post: November 1st, 2010, 07:04 AM
  4. Creating a class for points in three dimensions.
    By joachim89 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 8th, 2010, 07:13 PM
  5. Creating a class file
    By ipatch in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 8th, 2009, 07:19 PM