Nội dung text assignment-merged.pdf
NPTEL Online Certification Courses Indian Institute of Technology Kharagpur PROGRAMMING IN JAVA Assignment 1 TYPE OF QUESTION: MCQ Number of questions: 10 Total mark: 10 × 1 = 10 QUESTION 1: Which of the following is NOT a primitive data type in Java?? a. int b. boolean c. String d. char Correct Answer: c Detailed Solution: String is not a primitive data type. __________________________________________________________________________ QUESTION 2: Consider the following program. What is the output of the above code? a. 127 b. -127 c. 129 d. 2 Correct Answer: b public class Question{ public static void main(String[] args){ byte x = 127; x++; ++x; System.out.print(x); } }