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: 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: 42958
    
  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: 20080
    
  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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: why is this simple program dispalying compile error?
 
It's not a secret anymore!