What is the output of the following Java code?
ArrayList is an ordered collection which grows dynamically
Which type parameter is commonly used in a generic class to represent any type of object?
What does JNDI stand for?
What is polymorphism in object-oriented programming (OOP)?
Which of the options describe the correct default values for array elements?
class A {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
if (var1)
System.out.println(var1);
else
System.out.println(var2);
}
}
What is the output of the following Java code?
class CommaOperator {
public static void main(String[] args) {
int sum = 0;
for (int i = 0, j = 0; i < 5 && j < 5; ++i, j = i + 1)
sum += i;
System.out.println(sum);
}
}
What is the output of the following program?
public class Test
{
private static float temp()
{
public static float sum = 21;
return(--(sum));
}
public static void main(String[] args)
{
Test test = new Test();
System.out.println(test.temp());
}
}
1. class square_root
2. {
3. public static void main(String args[])
4. {
5. double a, b;
6. a = 8.0;
7. b = 6.0;
8. double c = Math.sqrt(a * a + b * b);
9. System.out.println(c);
10. }
11. }