| Q1: What will be the output of following code? |
class Test { |
now this question for testing the sequence of fields to initialize. |
| Q2: What will be the output of following code? |
byte b =0; |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q3: What will be the output of following code? |
if(new Boolean("true")==new Boolean("true")) System.out.println("FALSE"); |
| FALSE (they are two diffrenent objects) |
| Q4: What will be the output of following code? |
class AA{ |
| Answer: b=(B)a Compilation Error |
| Q5: What will be the output of following code? |
class AA{ |
| Answer: Compilation Error (Instance method cannot override the static method from class AA) |
| Q6: What will be the output of following code? |
class AA{ |
| Answer: Compilation Error (static method can not hide the instance method from AA) |
| Q7: What will be the output of following code? |
class Test { |
Output: (You can access static method with subclass reference) A |
| Q8: What will be the output of following code? |
class Test { |
| Output: 2 |
| Q9: What will be the output of following code? |
ArrayList list = new ArrayList(); Collections.sort(list); |
| Answer: Compile but not run. Throw runtime exception – ClassCastException.Collection.sort(List |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
| Q2: What will be the output of following code? |
code code |
| Welcome to Java (because in byte, when b=127 and then next iteration it will be -1) |
No comments:
Post a Comment