Become Oracle Certified with updated 1Z0-808 exam questions and correct answers
Consider below code of Test.java file:
1. package com.sampleproject.oca;
2.
3. class Super {
4. public String num = "10"; //Line n1
5. }
6.
7. class Sub extends Super {
8. protected int num = 20; //Line n2
9. }
10.
11. public class Test {
12. public static void main(String[] args) {
13. Super obj = new Sub();
14. System.out.println(obj.num += 2); //Line n3
15. }
16. }
What will be the result of compiling and executing above code?
Given this code for a Planet object:

What will be the result of compiling and executing Test class?
package com.udayan.oca;
public class Test {
static String msg; //Line 2
public static void main(String[] args) {
String msg; //Line 4
if(args.length > 0) {
msg = args[0]; //Line 6
}
System.out.println(msg); //Line 8
}
}
Range of short data type is from -32768 to 32767
Which of the following code segments, written inside main method will compile successfully?
Select 3 options.
Which of the following method is declared in Predicate
© Copyrights DumpsCertify 2026. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.