Consider the following code snippet:
int x=0; int y=50/x;
System.out.println("Division by zero");
catch(ArithmeticException e)
System.out.println("catch block");

What will be the output?

A. Error. Won't compile

B. Division by zero

C. Catch block

D. Division by zero catch block

You can do it
  1. Which javadoc tag is used to denote a comment for methods parameters?
  2. JdbcOdbcDriver is an object of Object class
  3. Which of the following methods can be used to remove a component from the display?
  4. Throwing an exception always causes program termination.
  5. The expression (x == y && a<b) is true If either x == y is true or a<b is true.
  6. The import statement is always the first no comment statement in a Java program files.
  7. To delete a file, we can use an instance of class file.
  8. Consider the following code snippet: try {int x=0; int y=50/x; System.out.println("Division by zero");…
  9. It is an error to have a method with the same signature in both the super class and its subclass.
  10. forName() is a static factory method
  11. If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value 15 to x.
  12. Which of the following classes are available in the java.lang package?
  13. Every method of a final in class is implicitly final.
  14. A constructor must always invoke its supper class constructor in its first statement.
  15. In evaluating a logical expression of type 'Boolean expression 1&& Boolean expression 2', both the Boolean…
  16. Which exception is thrown by the read() method of InputStream class?
  17. If you want to assign a value of 99 to the variable year, then which of the following lines can be used…
  18. For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.
  19. Which of the following represent legal flow control statements?
  20. It is perfectly legal to assign a subclass object to a supper class reference.
  21. All the bitwise operators have the same level of precedence in Java.
  22. Which key word can protect a class in package from accessibility by the classes outside the package?
  23. The check box group class is a subclass of the component class.
  24. executeUpdate(------------) returns ___________
  25. When we invoke repaint () for a Component, the AWT invokes the method:
  26. It is an error if a class with one or more abstract methods is not explicitly declared abstract.
  27. Which of the following command lines options generates documentation for all classes and methods?
  28. The length of a string object 's1' can be obtained using the expression s1.length.
  29. The modulus operator (%) can be used only with Integer operands.
  30. When we implement an interface method, it should be declared as public.