Vit University (Estd. U/s 3 of Ugc

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

VIT UNIVERSITY

(ESTD. U/S 3 OF UGC ACT 1956)


SCHOOL OF INFORMATION TECHNOLOGY & ENGG
QUIZ I

Name : _________________________________ Reg No. ___________________

1. What is the size of float data type in java


1. 8
2. 32
3. 16
4. 64

2. What is the value stored in result after executing the following lines in a program.
Result = 6/2*3;
1. 1.2
2. 1
3. 9
4. 0

3. Select the valid declaration


1. int i=16.0;
2. byte b=16.0;
3. float f=16.0;
4. double d=16.0;
5. char \u0063=’\u0063’;

4. Which of the following statements are valid array declarations?


1. int numbers();
2. float average[];
3. double[] marks;
4. counter int[]

5. What is the result of trying to compile and run this

public class AQuestion{


private int i = giveMeJ();
private int j = 10;
private int giveMeJ(){
return j;
}
public static void main(String args[]){
System.out.println((new AQuestion()).i);
}
}

1. Compiler error complaining about access restriction of private variables of AQuestion.


2. Compiler error complaining about forward referencing.
3. No Compilation error - The output is 0;
4. No Compilation error - The output is 10;

You might also like