Which of these is a wrapper class for the simple data type float?
Which of these Exception handlers cannot be type parameterized?
The command javac
class test{
public static void main (String[] args) {
int x=10,y=15;
if(x++<10 || --y>15)
{
x--;
}
else
{
y--;
}
System.out.println(x+" "+(++y));
}
}
class test{
public static void main (String[] args) {
int x=10,y=15;
if(x++<10 || --y>15)
{
x++;
}
else
{
y--;
}
System.out.println(x+" "+(--y));
}
}
What will be the output of the following Java code running with “java Abc I love to code”?
public class Abc
{
public static void main(String args[])
{
System.out.println(args[0]+""+args[args.length-1]);
}
}
class test{
public static void main (String[] args) {
int[] A=new int[2];
int[] B=A;
System.out.println(A[0]);
System.out.print(B[0]);
}
}
Predict the output of the following Java code.
import java.util.*;
import java.util.stream.IntStream;
class Abekus {
public static void main(String[] args) {
IntStream i = IntStream.range(2, 5);
int j = i.peek(System.out::print).sum();
System.out.println(j);
}
}
Predict the output of the following Java code.
class Abekus {
public static void main(String[] args)
{
int a1[] = new int[10];
int a2[] = new int['b'];
byte b = 15;
int a3[] = new int[b];
System.out.println(a1.length);
System.out.println(a2.length);
System.out.println(a3.length);
}
}
What will be the output of the following Java program?
import java.io.*;
public class filesinputoutput
{
public static void main(String[] args)
{
String obj = "abc";
byte b[] = obj.getBytes();
ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
for (int i = 0; i < 2; ++i)
{
int c;
while ((c = obj1.read()) != -1)
{
if (i == 0)
{
System.out.print(Character.toUpperCase((char)c));
}
}
System.out.println();
}
}
}