How many access modifiers are there in Java?
Which class is related to all the exceptions that cannot be caught?
Predict the output of the following Java program.
What is the output of the following Java code?
class rightshift_operator
{
public static void main(String args[])
{
int x;
x = 10;
x = x >> 1;
System.out.println(x);
}
}
PollFirst() is used to remove the first element
Predict the output of the following Java code:
class Abekus {
public static void main(String args[])
{
String s = "Welcome to Abekus";
char a[] = new char[8];
s.getChars(0, 6, a, 0);
System.out.println(a);
}
}
Which of the following is true?
void start() {
A a = new A();
B b = new B();
a.s(b);
b = null; /* Line 5 */
a = null; /* Line 6 */
System.out.println("start completed"); /* Line 7 */
}
When is the B object, created in line 3, eligible for garbage collection?
What will be the code output?.
package com.pk3;
public class Abekus{
protected void m1()
{
System.out.println("Protected method has been called.");
}
}
package com.pkg2;
import com.pk3.Abekus;
public class def extends Abekus {
public static void main(String args[]) {
def d=new def();
d.m1();
}
}
Note: Two classes are there.class def inherit the class Abekus.