Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 14


What is wrong with this program?


OCJP 1.6 Certified
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1067

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: 14

illegal start of expression
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1067

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

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: 250

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


Astha - OCPJP 6 (90%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java problems
 
It's not a secret anymore!