aspose file tools*
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
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: 1477
    
    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: 1477
    
    6

Yes it does, see the api declaration


http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createNewFile()
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt:Sequence of the output