Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegal start of expression

 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been tired to find the reason for illegal start of expression help

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic