Home / Programming Questions / JAVA MCQs / Page 4

JAVA MCQs with answers Page - 4

Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

(A) @Basic
(B) @Entity
(C) @Query
(D) @Column

(A) False
(B) True
(C) ---
(D) ---

(A) Two type are compatible and size of destination type is shorter than source type.
(B) Two type are compatible and size of destination type is equal of source type.
(C) Two type are compatible and size of destination type is larger than source type.
(D) All of the above

(A) short to int
(B) byte to int
(C) int to long
(D) long to int

Code:
class A{
        public static void main(String args[]){
	        byte b;
   	        int i = 258;
	        double d = 325.59;

	        b = (byte) i;
	        System.out.print(b);

	        i = (int) d;
	        System.out.print(i);

                b = (byte) d;
                System.out.print(b);
        }
}
(A) 258 325 325
(B) 258 326 326
(C) 2 325 69
(D) Error

(A) @FunctionInterface
(B) @SafeVarags
(C) @Overriden
(D) @Deprecated

(A) Interface
(B) Field
(C) Class
(D) Method

(A) Java 8
(B) Java 7
(C) Java 5
(D) Java 6

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.