wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Doubt:Sequence of the output 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 "Doubt:Sequence of the output" Watch "Doubt:Sequence of the output" New topic
Author

Doubt:Sequence of the output

mansi gupte
Ranch Hand

Joined: Dec 30, 2008
Posts: 72


answer: false
true
true


how do we arrive at this answer shouldn't it be
false
false
true
according to the sequence in which the print statements are written?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6



Swastik
mansi gupte
Ranch Hand

Joined: Dec 30, 2008
Posts: 72


i understand this, but doesn't it print the value assigned to newfile , like a good compiler?? or is it that it resolves to a boolean expression?
mansi gupte
Ranch Hand

Joined: Dec 30, 2008
Posts: 72
ok.... the print statement actually does resolve into a boolean expression

and the question for the 2nd answer is -> did the createNewFile method create a new file?

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Yes it does, see the api declaration


http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createNewFile()
 
jQuery in Action, 2nd edition
 
subject: Doubt:Sequence of the output
 
Similar Threads
Writing a FileOutputStream into a File
file Deletion
Files
[solved]what the syntax for "if file not exists"?
Creating files using Class file