Forums Register Login

Defining a Class

+Pie Number of slices to send: Send
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;
}
}
+Pie Number of slices to send: Send
I got it. Thanks anyways.
Ryan Newcombe
We find this kind of rampant individuality very disturbing. But not this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 548 times.
Similar Threads
Question on Local classes .
Method Overloading and overriding
Learning EJB3 on JBOSS 4.22
Inner Class method acess
The Ducks are back
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:07:04.