Which of the following will programmatically throw an exception?
Correct Answer: throw new Exception();
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Java Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Java MCQ Questions
Output of the given console application? public class Test31 { public static void main(String[] args) { test(); } public static void test() { try { System.out.print('-try'); return; } catch (Exception e) { System.out.print('-catch'); } finally { System.out.print('-finally'); } } }
Assuming the custom tag is GLOOP and the prefix is TWONG, which is the correct JSP syntax for an empty custom tag?
Which is true regarding DDL statements?
1 2 <%=23*counter %> 3 Congratulations! Which of the following is the correct way to complete the code snippet above?
Which correctly creates a thread using Runnable()?
What is the output for the below code? public class Test { public static void main(String[] args){ String value = “abc”; changeValue(value); System.out.println(value); } public static void changeValue(String a){ a = “xyz”; } }
ou have two class files name Test.class and Test1.class inside javaproject directory. Test.java source code is: public class Test{ public static void main (String[] args){ System.out.println(“Hello Test”); } } Test1.java source code is : public class Test1{ public static void main (String[] args){ System.out.println(“Hello Test1″); } } you have issued below commands from command prompt. cd javaproject java Test Test1 What is the output?
Find the given file. package com.concretepage; class Road { public static void main(String[] args) { for(int __x = 0; __x < 3; __x++) ; int #lb = 7; long [] x [5]; Boolean []ba[]; } enum Traffic { RED, YELLOW, GREEN }; } What is the result?
What is the output for the below code? public class A { static{System.out.println(“static”);} { System.out.println(“block”);} public A(){ System.out.println(“A”); } public static void main(String[] args){ A a = new A(); } }
What is the output for the below code? interface A { public void printValue(); } 1. public class Test{ 2. public static void main (String[] args){ 3. A a1 = new A() { 4. public void printValue(){ 5. System.out.println(“A”); 6. } 7. }; 8. a1.printValue(); 9. } 10. }