Logo

Java Questions Set 21:

Quiz Mode

Which .NET class contains only floating-point functions?

1
2
3
4

Solution:

What will be the output of the following Java program?

1
2
3
4

Solution:

who is responsible to perform method resolution?

1
2
3
4

Solution:

A legal declaration of Abstract 

1
2
3
4

Solution:

class GFG {

public static void main (String[] args) {

   String str=new String(100);

   System.out.print(Integer.parseInt(str,6));

}

}

1
2
3
4

Solution:

What will be the output of the following Java code?


class Output

{

public static void main(String args[])

{

Double i = new Double(257.578123456789);

float x = i.floatValue();

System.out.print(x);

}

}

1
2
3
4

Solution:

//Predict the output

import java.util.Scanner;

public class MyClass

{

public static void main(String args[])

{

StringBuffer str = new StringBuffer("creater");

str.appendCodePoint(67);

System.out.println(" " + str);

}

}

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {
public static void main(String args[])
{
String str = "Java Programming";
String str1 = str.replace('g', '$');
System.out.println(str1.replace('a', '5'));
}
}

1
2
3
4
5

Solution:

What will be the output of the following Java code?

class calculate

{

public static void main (String[] args)

{

int a=4;

System.out.print(a * 5); //1

System.out.print(" " + --a * 5); //2

System.out.print(" " + a-- * 5); //3

System.out.print(" " + a * 5); //4

}

}

1
2
3
4

Solution: