Benjamin Watson

Greenhorn
+ Follow
since May 12, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Benjamin Watson

I'd like to say this is the first time CaSe-SenSitiviTy has been the issue in my java sources, but that would be bold faced lie. Thanks a ton for the help, and for the information about java and it's .class files.
12 years ago
Hi, this is probably a really stupid question. I am learning java and it's my first time in an OO environment. Trying to write my first multi-class routine and I am having difficulties making the non-main class. This is taken from the head first java book.

My Dog.java file reads:


When I compile I get:

Dog.java:9: Missing return statement
}
^
1 Error

I'm usually pretty good at debugging code, at least in non-OO like C, but I can't seem to figure this one out.

Also, correct me if I'm wrong, but my understanding is that when I'm done I'm going to have several .class files and I'll run the one with main. Can anyone tell me how the JVM finds the correct classes to run? Maybe I'm worrying about things I shouldn't, but it feels weird trusting it to just find the correct file when it's supposed to...
12 years ago