Return type of uncaught_exception() is ___________.
Which of the following keyword prevents inheritance of a class?
Predict the output of the following Java code:
Which loop is more efficient for iterating through an array?
What is the use of final keyword in Java?
Predict the output.
class Abekus {
public static void main(String args[])
{
String str = " Welcome to Abekus ";
System.out.println(str.trim());
}
}
class GFG {
public static void main (String[] args) {
int x,y;
x=5;
{
y=6;
++y;
}
System.out.println(x+" "+(++(++y)));
}
}
What will be the output of the program?
class Test
{
public static void main(String [] args)
{
Test p = new Test();
p.start();
}
void start()
{
boolean b1 = false;
boolean b2 = fix(b1);
System.out.println(b1 + " " + b2);
}
boolean fix(boolean b1)
{
b1 = true;
return b1;
}
}
Predict the output of the following Java code.
class Abekus {
void go()
{ long[] l1 = { 6, 10, 4, 14 };
long[] l2 = relax(l1);
System.out.print(l1[0] + l1[1] + l1[2] + l1[3] + " ");
System.out.println(l2[0] + l2[1] + l2[2] + l2[3]);
}
long[] relax(long[] l)
{ l[2] = 10;
return l;
}
public static void main(String[] args)
{
Abekus A = new Abekus();
A.go();
}
}
class method
{
static int i;
static int j;
void add(int a , int b)
{
i =++j + ++b;
j =++i + b++;
}
}
class output
{
public static void main(String args[])
{
method obj1 = new method();
method obj2 = new method();
int a = 5;
obj1.add(++a, ++a + 1);
obj2.add(6, a);
System.out.println(obj1.i+" "+obj2.j);
}
}