PDF Google Drive Downloader v1.1


Báo lỗi sự cố

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); } }
NPTEL Online Certification Courses Indian Institute of Technology Kharagpur Detailed Solution: Range of byte data in java is -128 to 127. But the byte data type in java is cyclic in nature. ___________________________________________________________________________ QUESTION 3: Which of the following concept that Java doesn’t support? a. inheritance b. encapsulation c. pointer d. array Correct Answer: c Detailed Solution: Java does not support pointer. ______________________________________________________________________ QUESTION 4: Which of the following is not a keyword in java? a. import b. super c. method d. class Correct Answer: c Detailed Solution: Here, import, super and class are reserved keywords in Java, which cannot be used for naming a variable or class. ______________________________________________________________________

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.