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



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

Joined: Aug 01, 2009
Posts: 1055

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: 41517
    
  53
Static blocks are run when the class is loaded - which it will be when class App is used in class Exe.


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: why is this simple program dispalying compile error?