What's wrong ?

Discussion in 'Java' started by FopZ, Apr 26, 2007.

  1. FopZ

    FopZ Guest

    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!
    FopZ, Apr 26, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Salisha Khan
    Replies:
    1
    Views:
    11,649
    JohnFol
    Aug 1, 2003
  2. Replies:
    2
    Views:
    390
  3. Pial
    Replies:
    4
    Views:
    56,694
    Phatman
    Aug 27, 2010
  4. Paul Leventis

    Re: Quartus bug or wrong VHDL?

    Paul Leventis, Jun 24, 2003, in forum: VHDL
    Replies:
    0
    Views:
    2,466
    Paul Leventis
    Jun 24, 2003
  5. Matthew
    Replies:
    7
    Views:
    666
    Priscilla Walmsley
    Jan 7, 2005
Loading...

Share This Page