Quiz Discussion

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?

Course Name: Java

  • 1]

    -128 to 127 ASCII

  • 2]

    0 to 256 ISO-LATIN-1

  • 3]

    0 to 32767 UNICODE

  • 4]

    0 to 65535 UNICODE

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 the following are legal lines of Java code?

   1. int w = (int)888.8;
   2. byte x = (byte)100L;
   3. long y = (byte)100;
   4. byte z = (byte)100L;
  • 1]

    1 and 2

  • 2]

    2 and 3

  • 3]

    3 and 4

  • 4]

    All statements are correct

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 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
4
Discuss

Which one is a valid declaration of a boolean?

  • 1]

    boolean b1 = 1;

  • 2]

    boolean b2 = ‘false’;

  • 3]

    boolean b3 = false;

  • 4]

    boolean b4 = ‘true’

Solution
5
Discuss

What is the output of below code snippet?

   double a = 0.02;
   double b = 0.03;
   double c = b - a;
   System.out.println(c);
 
   BigDecimal _a = new BigDecimal("0.02");
   BigDecimal _b = new BigDecimal("0.03");
   BigDecimal _c = b.subtract(_a);
   System.out.println(_c);

 

  • 1]

    0.009999999999999998
    0.01

  • 2]

    0.01
    0.009999999999999998

  • 3]

    0.01
    0.01

  • 4]

    0.009999999999999998
    0.009999999999999998

Solution
6
Discuss

Which data type value is returned by all transcendental math functions?

  • 1]

    int

  • 2]

    float

  • 3]

    double

  • 4]

    long

Solution
7
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
8
Discuss

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

  • 1]

    Syntax

  • 2]

    Memory usage

  • 3]

    Garbage creation

  • 4]

    Precision

Solution
9
Discuss

Which of these values can a boolean variable contain?

  • 1]

    True & False

  • 2]

    0 & 1

  • 3]

    Any integer value

  • 4]

    True

Solution
10
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
# Quiz