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. Which of the following methods can be used to change the size of a size() *resize()
  2. Message-Driven beans act as a listener for the Java Message Service API, processing messages synchronously
  3. Which of the following methods belong to the String class?
  4. It is an error to catch the same type of exception in two different catch blocks associated with a particular…
  5. putValue(...) method takes _____________________-
  6. When we invoke repaint () for a Component, the AWT invokes the method:
  7. What is java -g used for?
  8. An individual array element that is passed to a method and modified in that method will contain the…
  9. We would like to make a member of a class visible in all subclasses regardless of what package they…
  10. When we implement the Runnable interface, we must define the method
  11. The length of a string object 's1' can be obtained using the expression s1.length.
  12. Declaring a method synchronized guarantees that the deadlock cannot occur.
  13. A method declared as static can not access non-static class members.
  14. In RMI before running the client program we must start RMI Registry.
  15. Every call to wait has a corresponding call to notify that will eventually end the wafting.
  16. Two methods cannot have the same name in Java.
  17. All methods in an abstract class must be declared abstract.
  18. Java is fully object oriented programme.
  19. It is perfectly legal to assign a subclass object to a supper class reference.
  20. Consider the following statements: int x = 10, y = 15; x = ((x < y) ? (y + x) : (y - x); What will…
  21. A class may be both abstract and final.
  22. It is perfectly legal to refer to any instance variable inside of a static method.
  23. The programmer must explicitly create the system .in and system .out objects.
  24. The import statement is always the first no comment statement in a Java program files.
  25. Throwing an exception always causes program termination.
  26. When the string objects are compared with ==, the result is true If the strings contain the same values.
  27. One the features of is that an array can store many different types of values.
  28. Which exception is thrown by the read() method of InputStream class?
  29. A catch can have comma-separated multiple arguments.
  30. If you want to assign a value of 99 to the variable year, then which of the following lines can be used…