Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

What's wrong ?

Thread view: 
FopZ - 26 Apr 2007 09:59 GMT
Hi

I have to create the following project

public class Messanger {

   publicMessanger () {
       // TODO implement constructor

   }

   public String getBye() {
       // TODO implement method
       return null;
   }

   public String getHello() {
       // TODO implement method
       return null;
   }

   public String getName() {
       // TODO implement method
       return null;
   }

   public void sayBye() {
       // TODO implement method

   }

   public void sayHello() {
       // TODO implement method

   }

   public void setName() {
       // TODO implement method

   }

}

My suggestion is this version:

public class Messanger {

    private String name;
    private String bye;
    private String hello;

   public Messanger (String newName, String newHello, String newBye)
{
       // TODO implement constructor

       name = newName;
       bye = newBye;
       hello = newHello;

   }

   public String getBye() {
       // TODO implement method
       return bye;
   }

   public String getHello() {
       // TODO implement method
       return hello;
   }

   public String getName() {
       // TODO implement method
       return name;
   }

   public void sayBye() {
       // TODO implement method
     System.out.println (bye + "!");
   }

   public void sayHello() {
       // TODO implement method
     System.out.println (hello + (" ") + name + ("!"));
   }

   public void setName(String newName) {
       // TODO implement method
      name = newName;

   }

}

I don't know how i can do it right. My version wasn't accepted by the
tester.
I hope someone can help!
Oliver Wong - 26 Apr 2007 15:39 GMT
> Hi
>
> I have to create the following project

[snip code]

> I don't know how i can do it right. My version wasn't accepted by the
> tester.
> I hope someone can help!

   Is "the tester" a human person? If so, perhaps you could ask them what
it was about your code that they found unacceptable.

   If, instead, "the tester" is a piece of software, perhaps you can read
the documentation on it to find out how it determines whether code is
acceptable or not.

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.