Home

Consider the following code snippet:
try 
{
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. A method declared as static can not access non-static class members.
  2. It is perfectly legal to assign a subclass object to a supper class reference.
  3. If you want to assign a value of 99 to the variable year, then which of the following lines can be used…
  4. Submit button always fires doPost(...)
  5. Which of the following classes are available in the java.lang package?
  6. For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.
  7. In the code below, what data types the variable x can have?
  8. Which of the following statements are true?
  9. A Java monitor must either extend thread class or implement Runnable interface.
  10. In RMI before running the client program we must start RMI Registry.
  11. class.forName(...) creates an instance of java ODBC driver
  12. An EJB is a server-side component that encapsulates the business logic of an application
  13. Which exception is thrown by the read() method of InputStream class?
  14. What is wrong in the following class definitions? abstract class print { abstract show();} class…
  15. The check box group class is a subclass of the component class.
  16. The programmer must explicitly create the system .in and system .out objects.
  17. Which of the following keywords are used to control access to a class member?
  18. Objects are passed to a method by use of call-by-reference.
  19. executeUpdate automatically updates data because___________
  20. In a single Servlet class we can use____________
  21. Any method in a supper class can be over ridden in its subclass.
  22. Consider the following class definitions: class maths { student student1; } class student { String name;…
  23. Which of the following methods belong to the String class?
  24. All the bitwise operators have the same level of precedence in Java.
  25. It is perfectly legal to refer to any instance variable inside of a static method.
  26. If m and n are int type variables, what will be the result of the expression'm % n' when m = -14 and…
  27. EJBs can be of the following type(s)None of the above
  28. Which of the following statements are valid array declarations?
  29. In RMI we invoke client method from remote server
  30. Which of the following methods can be used to change the size of a size() *resize()