wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Find errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Find errors" Watch "Find errors" New topic
Author

Find errors

Mak Harry
Greenhorn

Joined: Apr 18, 2003
Posts: 1
Pls. help me to explain what is wrong with this program and identify the number of iterations through the loop.

UBB code brackets added
[ April 18, 2003: Message edited by: Barry Gaunt ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
The modifiers on the main method are wrong. It should be public static void main(String[] args).
Why not add a counter, and compile and run your program?
What happens when b is 127 and b++ is performed?
[ April 18, 2003: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Mak
Welcome
The modifiers on the main method are wrong. It should be public static void main(String[] args).

And identify the number of iterations through the loop.
In your main method

I hope that i can explain clear


Francis Siu
SCJP, MCDBA
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Also, you will want to study and understand the output from this code:

Try replacing "byte num" with "short num" or "int num" to see what happens.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Find errors
 
Similar Threads
Default constructor
casting with interface
Trouble crafting regular expression.
Two public classes
Cannot find the symbol