In which Java library is the Event class defined?
Which statement can be used to skip the current iteration?
Predict the output of the following Java code.
Which attribute is used to specify the destroy method in Spring?
Which of the following allows the programmer to explicitly destroy an object?
You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
public class outputs
{
static int math(int x){
return ++x*x%32 + x*x%5 + x*x%10;
}
public static void main(String args[]){
int result=outputs.math(12);
System.out.println(result);
}
}
Predict the output of the following Java code.
import java.util.*;
class Abekus {
public static void main(String args[]) {
Formatter F = new Formatter();
F.format("%+d", 345);
System.out.println(F);
F.format("%+d", -230);
System.out.println(F);
}
}
Predict the output of the following Java code:
class Abekus {
public static void main(String args[])
{
String str = "Java Programming";
String str1 = "Java";
System.out.println(str.indexOf("a"));
System.out.println(str.indexOf("m"));
System.out.println(str.lastIndexOf("a"));
System.out.println(str.lastIndexOf("m"));
}
}
Select the correct output for the following code.
class Abekus {
public static void main(String[] args)
{
int d1 = 4567; // line 1
double d2 = 23.9878; // line 2
double d3 = 679.34557; // line 3
System.out.println(d1);
System.out.println(d2);
System.out.println(d3);
}
}