wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Defining a Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Defining a Class" Watch "Defining a Class" New topic
Author

Defining a Class

Ryan Newcombe
Greenhorn

Joined: Oct 02, 2002
Posts: 24
My professor wants my duck to quak. I have the basic idea down but I am having trouble getting my classes in order. The program should print "QUAK" when run. Please help.

public class Lab24B {
public static void main(String[] args) {
new Duck().sayHello();
}
}
private class Duck {
public String sayHello(String Quak) {
Quak = "QUAK";
return Quak;
}
}
Ryan Newcombe
Greenhorn

Joined: Oct 02, 2002
Posts: 24
I got it. Thanks anyways.
Ryan Newcombe
 
jQuery in Action, 2nd edition
 
subject: Defining a Class