This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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 Head First Android this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Defining a Class
 
It's not a secret anymore!