Public class Main extends Thread
{ public static void main (string [] args){
Main m= new Main(); m.start(); System.out.println("Thread is now terminated"); } }
{ public static void main (string [] args){
Main m= new Main(); m.start(); System.out.println("Thread is now terminated"); } }
Anonymous Quiz
30%
Compile time exception
15%
Runtime Exception
41%
Thread is now terminated
13%
IllegalThreadStateException
Which of the following data structures is used to perform Recursion?
Anonymous Quiz
20%
Queue
17%
Linked List
43%
Stack
20%
Circular Queue
public class Main
{ public static void main (String [] args){
int[] a=new int[]; System.out.println(a[0]); } }
{ public static void main (String [] args){
int[] a=new int[]; System.out.println(a[0]); } }
Anonymous Quiz
12%
1
35%
0
41%
Compile time error
12%
Runtime error
public class Main
{ public static void main (String [] args){
int c= - -2; System.out.println(c); } }
{ public static void main (String [] args){
int c= - -2; System.out.println(c); } }
Anonymous Poll
29%
1
18%
-2
18%
2
35%
Error
public class Main
{
static void call(long x,long y){
System.out.println("long x,long y");
}
static void call(int... x){
System.out.println("int... x");
}
static void call(Number x,Number y){
System.out.println("Number x,Number y");
}
public static void main (String [] args){
int val= 3;
call(val,val);
}
}
A) An Exception is thrown at run time.
B) Compilation Error
C) Number x, Number y
D) long x,long y
E) int... x
{
static void call(long x,long y){
System.out.println("long x,long y");
}
static void call(int... x){
System.out.println("int... x");
}
static void call(Number x,Number y){
System.out.println("Number x,Number y");
}
public static void main (String [] args){
int val= 3;
call(val,val);
}
}
A) An Exception is thrown at run time.
B) Compilation Error
C) Number x, Number y
D) long x,long y
E) int... x
import java.util.Stack;
public class Main
{ public static void main (String [] args){ Stack s=new Stack(); s.push(new Integer(3)); s.push(new Integer(2)); s.pop(); s.push(new Integer(5)); System.out.println(s); } }
public class Main
{ public static void main (String [] args){ Stack s=new Stack(); s.push(new Integer(3)); s.push(new Integer(2)); s.pop(); s.push(new Integer(5)); System.out.println(s); } }
Anonymous Quiz
0%
[3,5,2]
38%
[3,2,5]
56%
[3,5]
6%
[3,2]
import java.util.Stack;
public class Main
{
int a=1;
int b=2;
Main func(Main m){
Main m3=new Main();
m3=m;
m3.a=m.a++ + ++m.a;
m.b=m.b;
return m3;
}
public static void main (String [] args){
Main m1=new Main();
Main m2=m1.func(m1);
System.out.println("m1.a= "+m1.a+" m1.b= "+m1.b);
System.out.println("m2.a= "+m2.a+" m2.b= "+m2.b);
}
}
A) m1.a= 4 m1.b=2
m2.a= 1 m2.b=2
B) m1.a= 4 m1.b=2
m2.a= 4 m2.b=2
C) m1.a= 1 m1.b=2
m2.a= 4 m2.b=2
D) Compilation Error
public class Main
{
int a=1;
int b=2;
Main func(Main m){
Main m3=new Main();
m3=m;
m3.a=m.a++ + ++m.a;
m.b=m.b;
return m3;
}
public static void main (String [] args){
Main m1=new Main();
Main m2=m1.func(m1);
System.out.println("m1.a= "+m1.a+" m1.b= "+m1.b);
System.out.println("m2.a= "+m2.a+" m2.b= "+m2.b);
}
}
A) m1.a= 4 m1.b=2
m2.a= 1 m2.b=2
B) m1.a= 4 m1.b=2
m2.a= 4 m2.b=2
C) m1.a= 1 m1.b=2
m2.a= 4 m2.b=2
D) Compilation Error
import java.util.Stack;
public class Main
{
public static void main (String [] args){
int i=5;
while(i>0){
System.out.print(--i);
}
while(i<=5){
System.out.print(i++);
}
}
}
A) 54321012345
B) 43210-1012345
C) 43210012345
D) 432101234
public class Main
{
public static void main (String [] args){
int i=5;
while(i>0){
System.out.print(--i);
}
while(i<=5){
System.out.print(i++);
}
}
}
A) 54321012345
B) 43210-1012345
C) 43210012345
D) 432101234
import java.util.Arrays;
public class Main
{
public static void main (String [] args){
int[] array=new int[5];
for(int i=5;i>0;i--){
array[5-i]=i;
}
Arrays.fill(array,1,4,8);
for(int i=0;i<5;i++){
System.out.print(array[i]);
}
}
}
A) 58881
B) 12885
C) 54881
D) 12845
public class Main
{
public static void main (String [] args){
int[] array=new int[5];
for(int i=5;i>0;i--){
array[5-i]=i;
}
Arrays.fill(array,1,4,8);
for(int i=0;i<5;i++){
System.out.print(array[i]);
}
}
}
A) 58881
B) 12885
C) 54881
D) 12845
Which of the below is/are DevOp tool?
Anonymous Quiz
4%
Sumo logic
14%
Apache ActiveMQ
18%
OverOps
64%
All of the above
public class Program
{
void Program(){//Line 3 System.out.println("Program class initiated"); } public static void main(String[] args) { new Program(); } }
{
void Program(){//Line 3 System.out.println("Program class initiated"); } public static void main(String[] args) { new Program(); } }
Anonymous Quiz
21%
Program class initiated
32%
Compilation Error
11%
Exception at line 3
37%
Program executes and no output
public class Program
{
public static void main(String[] args) { int i= -3,j=2,k=0,m; m= ++i && ++j && ++k; System.out.println(i+" "+j+" "+" "+k+" "+m); } }
{
public static void main(String[] args) { int i= -3,j=2,k=0,m; m= ++i && ++j && ++k; System.out.println(i+" "+j+" "+" "+k+" "+m); } }
Anonymous Quiz
28%
-2 3 1 1
17%
2 3 1 2
56%
Compilation Error
0%
3 3 1 2
Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
z = x + y * z / 4 % 2 - 1
Anonymous Quiz
26%
* / % + - =
32%
= * / % + -
37%
/ * % - + =
5%
* % / - + =
Which data structure is used in elevator system (most optimal)?
Anonymous Quiz
25%
Stack
25%
Queue
33%
Tree
17%
Linked List
Python set to overtake Java in latest programming language rankings | ZDNet
https://www.zdnet.com/google-amp/article/python-set-to-overtake-java-in-latest-programming-language-rankings/
https://www.zdnet.com/google-amp/article/python-set-to-overtake-java-in-latest-programming-language-rankings/
ZDNet
Python set to overtake Java in latest programming language rankings | ZDNet
After 20 years at the top of the programming-language tree, Java looks set to be overtaken by Python.
which of the following is not valid input for switch statement?
Anonymous Quiz
17%
Int
37%
Long
3%
Char
43%
String