Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

JAVA QUESTIONS : PART 1

What is the range of byte data type in Java?

-128 to 127
-32768 to 32767
-2147483648 to 2147483647
None of the mentioned
SHOW ANSWER

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 and 2
2 and 3
3 and 4
All statements are correct
SHOW ANSWER

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

int
long
byte
float
SHOW ANSWER

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

-1.7e+308
-3.4e+038
+1.7e+308
-3.4e+050
SHOW ANSWER

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

25
24
32
33
SHOW ANSWER

What is the output of this program?
 
    class area {
 
        public static void main(String args[]){
    
             double r, pi, a;

                 r = 9.8;

                 pi = 3.14;

                 a = pi * r * r;
 
                 System.out.println(a);
 
            } 
    
    }

301.5656
301
301.56
301.56560000
SHOW ANSWER

Which of these coding types is used for data type characters in Java?

ASCII
ISO-LATIN-1
UNICODE

None of the mentioned

SHOW ANSWER

Which of these values can a boolean variable contain?

True & False
0 & 1
Any integer value
true
SHOW ANSWER

Which of these is long data type literal?

0x99fffL
ABCDEFG
0x99fffa
99671246
SHOW ANSWER

Literal can be of which of these data types?

integer
float
boolean
all of the mentioned

SHOW ANSWER

Which of these can not be used for a variable name in Java?

identifier
keyword
identifier & keyword
None of the mentioned
SHOW ANSWER

What is the prototype of the default constructor of this class?
public class prototype { }

prototype( )
prototype(void)
public prototype(void)
public prototype( )
SHOW ANSWER

Which of these operators is used to allocate memory to array variable in Java?

malloc
alloc
new
new malloc

SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in