Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java problems" Watch "java problems" New topic
Author

java problems

prashant modak
Greenhorn

Joined: Nov 05, 2011
Posts: 13


What is wrong with this program?


OCJP 1.6 Certified
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

whats the error you are getting?


Click here for Static tutorials


http://www.lifesbizzare.blogspot.com || OCJP:81%
prashant modak
Greenhorn

Joined: Nov 05, 2011
Posts: 13

illegal start of expression
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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
Bartender

Joined: May 31, 2011
Posts: 1776
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

Joined: Oct 15, 2011
Posts: 249

You can call a method inside another method, but can't write its body inside another method.


Astha - OCPJP 6 (90%)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: java problems