Q1. Which method registers a thread in a thread scheduler?
A. run();
B. start();
C. construct();
D. register();
Q2. What is an instance of?
A. A methods in object
B. A keyword only
C. An operator and keyword
D. An operator only
Q3. Which one is not correct?
A. Class and object are just different names for the same thing
B. An object is a variable, where its type is the class used to declare the variable
C. A class needs to be instantiated as an object before being used
D. An objects exists in memory in run time
Q4. Which one needs a web page to run
A. A Java Application
B. A Java Stand-Alone Application
C. A Java Class
D. A Java Applet
Q5. What is the correct syntax for java main method?
A. Public static void main(string[] args)
B. Public void main(String[] args)
C. Public static void main()
D. None of the above
Q6. Given the declaration int [ ] nums = {8, 12, 23, 4, 15}, what expression will display the first element in the array (ie the number 8)
A. System.out.print("The number is : " + nums[1]);
B. System.out.print("The number is : " + nums[8]);
C. System.out.print("The number is : " + nums);
D. System.out.print("The number is : " + nums[0]);
Q7. Class B inherits from Class A, what cannot be said:
A. B has access to private members of A
B. B has access to protected members of A
C. A is a super-class of B
D. B is a sub-class of A
Q8. Choose the appropriate data type for this field: isSwimmer
A. boolean
B. double
C. string
D. int
Q9. The operations y >> 3 and y >>> 3 produce the same result when y > 0.
A. True
B. False
Q10. What do you mean by JRE?
A. java runtime environmentA. A Java Application
B. A Java Stand-Alone Application
C. A Java Class
D. A Java Applet
Q5. What is the correct syntax for java main method?
A. Public static void main(string[] args)
B. Public void main(String[] args)
C. Public static void main()
D. None of the above
Q6. Given the declaration int [ ] nums = {8, 12, 23, 4, 15}, what expression will display the first element in the array (ie the number 8)
A. System.out.print("The number is : " + nums[1]);
B. System.out.print("The number is : " + nums[8]);
C. System.out.print("The number is : " + nums);
D. System.out.print("The number is : " + nums[0]);
Q7. Class B inherits from Class A, what cannot be said:
A. B has access to private members of A
B. B has access to protected members of A
C. A is a super-class of B
D. B is a sub-class of A
Q8. Choose the appropriate data type for this field: isSwimmer
A. boolean
B. double
C. string
D. int
Q9. The operations y >> 3 and y >>> 3 produce the same result when y > 0.
A. True
B. False
Q10. What do you mean by JRE?
B. java runtime exception
C. java runtime execution
D. none of these
Answers:-
1. B. start();
2. C. An operator and keyword
3. A. Class and object are just different names for the same thing
4. D. A Java Applet
5. D. None of the above (public static void main(String args[]) is the right format.)
6. D. System.out.print("The number is : " + nums[0]);
7. A. B has access to private members of A
8. A. boolean
9. A. True
10. A. java runtime environment
No comments:
Post a Comment