Vidyalelo
Java Programming · all questions

Data Types and Variables
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

127

Questions

7/7

Page

Pick an option on a question to see the right answer and solution.

What is the order of variables in Enum?

Select an option to see the answer and solution.

How to get UTC time?

Select an option to see the answer and solution.

Which class is a library of functions to perform arithmetic operations of BigInteger and BigDecimal?

Select an option to see the answer and solution.

What will be the output of the following Java code snippet?
class A
{
 
}
 
enum Enums extends A
{
    ABC, BCD, CDE, DEF;
}

Select an option to see the answer and solution.

What will be the output of the following Java program?
class mainclass {
    public static void main(String args[]) 
    {
        boolean var1 = true;
  boolean var2 = false;
  if (var1)
      System.out.println(var1);
  else
      System.out.println(var2);
   } 
}

Select an option to see the answer and solution.

What is the limitation of toString() method of BigDecimal?

Select an option to see the answer and solution.

What will be the output of the following Java code snippet?
enum Enums
{
    A, B, C;
 
    private Enums()
    {
        System.out.println(10);
    }
}
 
public class MainClass
{
    public static void main(String[] args)
    {
        Enum en = Enums.B;
    }
}

Select an option to see the answer and solution.