This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons 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: 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: 41144
    
  45
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: 19655
    
  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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why is this simple program dispalying compile error?
 
Similar Threads
initialization order
final modifier semantic broken?
Question on execution of blocks
order?
Block execution