Get your CodeRanch badge!*
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
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
 
Similar Threads
Question on Local classes .
The Ducks are back
Learning EJB3 on JBOSS 4.22
Inner Class method acess
Method Overloading and overriding