This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!

salvin francis

Saloon Keeper
+ Follow
since Jan 12, 2009
salvin likes ...
Eclipse IDE Google Web Toolkit Java
Forum Moderator
salvin francis currently moderates these forums:
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by salvin francis

My suggestion for boolean :
12 hours ago
You've made a nice Decorator for Scanner. My only nitpick is can we call it something other than "Keyboard" ?
How about "KeyboardScanner" or Knute's "Inputer"
12 hours ago

Julio leopard banderas wrote:How many houres should i spend on this book?

This is a very odd question... I am not sure how any one would be able to answer that.

Campbell Ritchie wrote:...Effective Java by Joshua Bloch (Oracle Press); there was a 3rd edition about one year ago.

I think it would be best to refer to Effective Java once one has a good grip over all the topics. It's not a book for beginners, rather it's a guide for best practices.
13 hours ago
A couple of points on the above code:
1. Your indentations are not correct
2. It's unclear why "playGame" and "printResult" are static and "convertToString" is not static.
3. Use braces around if conditions

A small nitpick:
Do not display user messages in all caps
14 hours ago
I think the Rock paper scissors game has been discussed in our forum in the past. You can search and get good explanations such as using enums instead of Strings.
14 hours ago
Also what is "IoT" ? You are defining it as a class with xLocation, yLocation. If I am not wrong, IoT stands for Internet of Things and a class with that name would signify a device. I don't see how xLocation, yLocation fall in this paradigm.
You have a lot of code written in the main method, have a look at this:
1 day ago
I would like to point out that your naming conventions are not correct, I see some variables with capital letters and some class names in capital letters.

Here's a very old but still valid documentation about naming conventions:
1 day ago
Hi Andrew, Welcome to coderanch

A JFrame is a top-level window, you cannot add it to another Panel. However if you want to use internal frames, you can look at
2 days ago
Here's one interpretation out of many that satisfy your code:

2 days ago

I wrote: We also do not know if Hamburger or FastFood is a class or an interface.

My bad. I somehow missed reading "new Hamburger();"  !!!
It is a class.
2 days ago

If the above line compiles correctly, All that I can assume is that Hamburger IS-A FastFood. It means that Hamburger directly or indirectly lies in the inheritance chain of FastFood. We also do not know if Hamburger or FastFood is a class or an interface.
FastFood -> Foo -> Bar -> Hamburger
FastFood -> Hamburger

This line tells that Hamburger IS-A Food. and Food IS-A Item. Again, the above conditions qualify for this case too. I think that is precisely why Junilu asked you if "superclass" is your assumption or is a part of the original question.
2 days ago

Daniel Andersson wrote:... I meant to say that we can assume that food2 is a superclass of Hamburger...

From your code above,
food2 in this line of code is not a "class", it's a reference to a class called "Food"

Daniel Andersson wrote:Well I dont know what to tell you. Im a programing student and this is a question we got on our exam today. "What would be the difference between using the object food2 and the object h? " - Write down all your assumptions.

It would be helpful for us to know the source of such question and the above details in your original post.
2 days ago

Vadiks Charny wrote:No output for this code...

So, this answers my First and Second question, you did try it and you did not get any compilation errors. Now for my 3rd question..
Are you expecting no output ? (Stephan has given good hints about this)
4 days ago