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 4 of 4

Thread: pls help me check whether my coding have answer the question or not ... thx

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default pls help me check whether my coding have answer the question or not ... thx

    my question are :

    You also need to write a BossEmployeeDemo class that contains a main() method. The main method for this class should:
    1. create a single instance of the Boss class,
    2. call the staffUp method on the Boss object
    - ask user to input Employee name and ID
    3. call the list method on the Boss object
    4. Be sure that you also invoke appropriate methods in Employee class when you need to hire a staff.
    Last edited by Ling Nl; May 23rd, 2014 at 07:53 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: pls help me check whether my coding have answer the question or not ... thx

    As the error indicates, this statement:

    ArrayList[Employee] staff = new ArrayList[Employee](10);

    is not a proper Java statement. If you're trying to use a generic ArrayList, the statement should be:

    ArrayList<Employee> staff = new ArrayList<Employee>(10);

    Creating staff as a local variable to the method list() might be limiting, because you won't be able to use staff anywhere else, but it's not clear what you intend there.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    Ling Nl (May 23rd, 2014)

  4. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: pls help me check whether my coding have answer the question or not ... thx

    If you don't understand my answer, don't ignore it, ask a question.

  5. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: pls help me check whether my coding have answer the question or not ... thx

    @Ling Nl, please don't edit your posts to remove original content relative to the question - it removes all context to the thread and prevents others from understanding, learning, or helping. The moderator staff has the ability to revert your edits, and may take the initiative to do so if they feel it is necessary.

Similar Threads

  1. Pls check my code
    By javamonkey30 in forum Loops & Control Statements
    Replies: 12
    Last Post: March 18th, 2013, 02:26 PM
  2. [SOLVED] please answer this question,tq
    By suganti selvaraj in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 6th, 2013, 12:50 AM
  3. Any one pls tell answer quickly....
    By thirumani in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: July 13th, 2012, 06:18 AM
  4. Pls Answer...
    By sachin.garde in forum Exceptions
    Replies: 4
    Last Post: October 31st, 2011, 02:38 AM
  5. Pls answer( urgent)
    By sar in forum Java Theory & Questions
    Replies: 1
    Last Post: September 20th, 2011, 11:28 AM