Given code of Test.java file:
1. package com.sampleproject.oca;
2.
3. interface Blogger {
4. default void blog() throws Exception {
5. System.out.println("GENERIC");
6. }
7. }
8.
9. class TravelBlogger implements Blogger {
10. public void blog() {
11. System.out.println("TRAVEL");
12. }
13. }
14.
15. public class Test {
16. public static void main(String[] args) {
17. Blogger blogger = new TravelBlogger(); //Line n1
18. ((TravelBlogger)blogger).blog(); //Line n2
19. }
20. }
What will be the result of compiling and executing Test class?
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
}
}
Given the code fragment:

Given the code fragment:

Which statement is true about the switch statement?
© Copyrights Oracledumps 2025. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.