File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 12


What is wrong with this program?


OCJP 1.6 Certified (75%)
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1050

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

illegal start of expression
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1050

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

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
 
Similar Threads
static method
how to complie/run a java prog with 2 or more classes
Regarding Interface
java
class 1