This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes illegal start of expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "illegal start of expression" Watch "illegal start of expression" New topic
Author

illegal start of expression

saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

I have been tired to find the reason for illegal start of expression help



Tell the difficulties that i am difficult.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

the compareTo() method should be declared outside the main method. i remember this happening to me many times and pulling my hairs when i realised the mistake.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9957
    
163

saloni jhanwar wrote:I have been tired to find the reason for illegal start of expression help


That compile time error would also show the line number where this is happening. Have you checked that specific line and code around it? Hint: Pay attention to the line where the implementation of compareTo method has started.

[My Blog] [JavaRanch Journal]
saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

gurpeet singh wrote:the compareTo() method should be declared outside the main method. i remember this happening to me many times and pulling my hairs when i realised the mistake.


ouch
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: illegal start of expression
 
Similar Threads
how many objects will be eligible for garbage collection
Dan's Mock #4 Q. 25
Garbage Collection Qstn from K&B Doubt
inhertitance through multiple packages - not able to analyze the output-
Brute Force