aspose 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 Head First Android this week in the Android 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: 1067



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

Joined: Aug 01, 2009
Posts: 1067

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
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
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: 20044
    
  30

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 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: why is this simple program dispalying compile error?
 
It's not a secret anymore!