PROGRAMMING IN JAVA Assignment 1 | NPTEL | 2023

Computer Bits Daily
2 min readMar 28, 2024

PROGRAMMING IN JAVA Assignment 1 | NPTEL | Answer with Explanation

Test Your Java Fundamentals with a Challenging MCQ Assignment Sharpen your core Java skills with this engaging multiple-choice quiz (MCQ). Designed for beginners, this Assignment 1 assesses your understanding of fundamental Java concepts. Whether you’re new to programming or refreshing your knowledge, this MCQ challenge is a perfect way to gauge your progress and identify areas for improvement.

What is the incorrect statement about bytecode?

a. Java when compiles the source code, it converts it to bytecode.
b. JVM (Java Virtual Machine) is an interpreter of bytecode.
c. Bytecode is not portable and it needs to be compiled separately for each platform.
d. JVM offers a protected environment which helps in enhanced safety for the system.Answer

Consider the following program

public class Test {
public static void main(String[] args) {
//******* boolean b = false; *******/ //n1
String b = "false";
switch(b){ // n2
case "False":
System.out.println("a");
}
      }
}

What is the output of the above code?

a. a
b. Compiler error due to line n1
c. Compiler error due to line n2
d. Print nothing

--

--

Computer Bits Daily

Learning Computer skills and Computer technology by learning and sharing