JAVA
2.7K subscribers
73 photos
111 files
76 links
Download Telegram
Default value of float variable in java?
Anonymous Quiz
44%
0.0f
11%
0
33%
0.0
11%
1
class output {
public static void main(String args[])
{ double a,b,c; a=3.0/0; b=0/4.0; c=0/0.0 ; System.out.println(a); System.out.println(b); System.out.println(c); } What will be the output?
Anonymous Quiz
18%
Infinity
32%
0.0
23%
NaN
27%
all of the mentioned
class A
{
A()
{
System.out .println("Code");
}
A(String name)
{
this();
System.out.println("CodeQuotient : " + name);
}
}
public class Main extends A
{
Main()
{
System.out.println("Quotient");
}
Main(String name)
{
this();
System.out.println("CodeQuotient : " + name);
}
public static void main(String[] args)
{
Main b = new Main("Girdhar");
}
}
What will be the output?
Public class Main extends Thread
{ 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]); } }
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); } }
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
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); } }
Anonymous Quiz
0%
[3,5,2]
38%
[3,2,5]
56%
[3,5]
6%
[3,2]