Can we use nested try statements in java?
The return type of Constructor
The object of pattern class is used to compile a regular expression
Error is a serious problem that a reasonable application should not try to catch
When the object of a class is declared, each object contains its own copy of static variables
Which of the following interface does NOT implement the Collection interface?
Predict the output of the following Java code. Note that the function is public
in a base class and private
in a derived class.
Which of the following statements about constructors and the finalize() method are incorrect?
Predict the output?
// file name: Main.java
public class Main {
public static void main(String args[]) {
int[] arr = {12, 13, 14, 15, 40};
for (int i=0; i < arr.length; i++) {
System.out.print(" " + arr[i]);
}
}
}
class evaluate
{
public static void main(String args[])
{
int a[] = {2,3,4,5,6};
int d[] = a;
int sum = 0;
for (int j = 0; j < 3; ++j)
sum += (a[j] * d[j + 1]) + (a[j + 1] * d[j]);
System.out.println(sum);
}
}