Results 1 to 3 of 3

Thread: Java Classes

  1. #1
    new_java_dev is offline Member
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Default Java Classes

    Hi,

    I am new to Java, so excuse if this question is real basic:

    I have 3 questions.

    Write a Java class called Person which describes a person with these properties:
    - First Name
    - Last Name
    - Age

    Write a Java class which describes a company employee which uses the Person class above and adds two extra properties:
    - Position
    - Join Date

    Write a Java class called Company which contains
    - One or more employees
    - Business type

    I know how to do the first one:

    public class Person {

    String fName;
    String lName;
    int age;
    }

    But I am very trouble with the last two, please can someone help

    Thank you


  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Java Classes

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    340
    Rep Power
    5

    Default Re: Java Classes

    Write a Java class which describes a company employee which uses the Person class above and adds two extra properties:
    - Position
    - Join Date
    This requirement will illustrate the idea of inheritance. Are you familiar with this concept?

Similar Threads

  1. Replies: 0
    Last Post: 06-04-2012, 06:07 PM
  2. Replies: 0
    Last Post: 05-13-2012, 08:37 PM
  3. Replies: 0
    Last Post: 05-13-2012, 08:26 PM
  4. Replies: 0
    Last Post: 05-07-2012, 09:46 PM
  5. Replies: 0
    Last Post: 05-07-2012, 09:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •