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

java problems

 
prashant modak
Greenhorn
Posts: 14
Java Linux Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is wrong with this program?
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whats the error you are getting?


Click here for Static tutorials
 
prashant modak
Greenhorn
Posts: 14
Java Linux Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
illegal start of expression
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prashant modak wrote:illegal start of expression


You are getting this because you have a static method in the main method please read the note i have shared it with you
 
John Jai
Rancher
Posts: 1776
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have indented your code. As you see, there are methods written within a method which is not valid in Java.

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call a method inside another method, but can't write its body inside another method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic