File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ambiguous statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ambiguous statement " Watch "ambiguous statement " New topic
Author

ambiguous statement

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi
can anybody tell me, what is the meaning of second statement.
1.....Does not compile and
2.....Compiles but generates a compile time error
(if compile time error is there, how can a code compile)
Here is a sample below.
What will be the result of compiling the following code:
public class Test {
public static void main (String args []) {
int age;
age = age + 1;
System.out.println("The age is " + age);
}
}
Compiles and runs with no output
Compiles and runs printing out The age is 1
Compiles but generates a runtime error
Does not compile
Compiles but generates a compile time error
Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
Correct answer should be does not compile
forget about the option complies but gives complie time error
it is just to confuse you
Originally posted by shikhar:
Hi
can anybody tell me, what is the meaning of second statement.
1.....Does not compile and
2.....Compiles but generates a compile time error
(if compile time error is there, how can a code compile)
Here is a sample below.
What will be the result of compiling the following code:
public class Test {
public static void main (String args []) {
int age;
age = age + 1;
System.out.println("The age is " + age);
}
}
Compiles and runs with no output
Compiles and runs printing out The age is 1
Compiles but generates a runtime error
Does not compile
Compiles but generates a compile time error


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ambiguous statement
 
Similar Threads
difference btwn "does not compile" and "complie time error"
"does not compile" vs "compile time error"
What is the differenca
Compiles / Compiles but generate error??
Does not compile vs Compiles with Error? (John Hunt Mock Exam)