File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes why is this  simple  program dispalying compile error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why is this  simple  program dispalying compile error?" Watch "why is this  simple  program dispalying compile error?" New topic
Author

why is this simple program dispalying compile error?

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056



http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056

its running now sorry my syntax mistake, but i didnt get one thing. How come static block of app is displayed ,as i have saved it in Exe.java


and using javac Exe.java for compiling
and

java Exe to run it.


I was thinking that static blocks shouldnt run but in this case it is why so??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42916
    
  68
Static blocks are run when the class is loaded - which it will be when class App is used in class Exe.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

Take a look at the compiler errors; they are pretty straight forward:
Line 6 has one character too many, and line 13 is missing one.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why is this simple program dispalying compile error?