Quiz Discussion

An expression involving byte, int, and literal numbers is promoted to which of these?

Course Name: Java

  • 1]

    float

  • 2]

    byte

  • 3]

    long

  • 4]

    int

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

Which of these literals can be contained in float data type variable?

  • 1]

    -1.7e+308

  • 2]

    -3.4e+038

  • 3]

    +1.7e+308

  • 4]

    -3.4e+050

Solution
2
Discuss

What is the base of BigDecimal data type?

  • 1]

    Base 2

  • 2]

    Base 8

  • 3]

    Base 10

  • 4]

    Base e

Solution
3
Discuss

What will be the output of these statement?

public 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);
        } 
    }

 

  • 1]

    Infinity

  • 2]

    0.0

  • 3]

    NaN

  • 4]

    all of the mentioned

Solution
4
Discuss

What is the numerical range of a char data type in Java?

  • 1]

    -128 to 127

  • 2]

    0 to 256

  • 3]

    0 to 32767

  • 4]

    0 to 65535

Solution
5
Discuss

What will be the output of the following Java code? - Increment / Decrement

public class increment {
   public static void main(String args[]) 
     {        
         int g = 3;
         System.out.print(++g * 8);
     } 
}

 

  • 1]

    25

  • 2]

    24

  • 3]

    32

  • 4]

    33

Solution
6
Discuss

What is the range of short data type in Java?

  • 1]

    -128 to 127

  • 2]

    -32768 to 32767

  • 3]

    -2147483648 to 2147483647

  • 4]

    None of the mentioned

Solution
7
Discuss

What is the range of byte data type in Java?

  • 1]

    -128 to 127

  • 2]

    -32768 to 32767

  • 3]

    -2147483648 to 2147483647

  • 4]

    None of the mentioned

Solution
8
Discuss

What is the output of this program?

public class array_output {
        public static void main(String args[]) 
        {    
            char array_variable [] = new char[10];
            for (int i = 0; i < 10; ++i) {
                array_variable[i] = 'i';
                System.out.print(array_variable[i] + "" );
                i++;
            }
        } 
    }

 

  • 1]

    i i i i i

  • 2]

    0 1 2 3 4

  • 3]

    i j k l m

  • 4]

    None of the mentioned

Solution
9
Discuss

Which of the following is the advantage of BigDecimal over double?

  • 1]

    Syntax

  • 2]

    Memory usage

  • 3]

    Garbage creation

  • 4]

    Precision

Solution
10
Discuss

What is the numerical range of a char data type in Java?Which of these coding types is used for data type characters in Java?

  • 1]

    -128 to 127 ASCII

  • 2]

    0 to 256 ISO-LATIN-1

  • 3]

    0 to 32767 UNICODE

  • 4]

    0 to 65535 UNICODE

Solution
# Quiz