This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: How to fix illegal start of expression error in java
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
In this post, we will see how to fix “illegal start of expression” in java. You will get this error while using javac command in command prompt. In eclipse or any other ide, it will give you more helpful compile time error. There can be multiple reasons for getting this error. Using private, public or protected modifiers inside a method You might know that you can not useĀ private, public or protected modifier inside a method. If you use it, you will getĀ illegal start of expression. When you run javac Command, you will get below error. $javac MyClass.java /MyClass.java:4: error: