{Week 1} Programming In Java nptel Assignment Answers 2025

NPTEL Programming In Java Week 1 Assignment Answers 2025

1. Which of the following is true?

a. Java uses only interpreter.
b. Java uses only compiler.
c. Java uses both interpreter and compiler.
d. None of the above.

Answer :- c

2. A Java file with extension ‘class’ contains

a. Java source code
b. HTML tags
c. Java Byte code
d. A program file written in Java programming language

Answer :- c

3. Which of the following is not an object-oriented programming paradigm?

a. Encapsulation
b. Inheritance
c. Polymorphism
d. Dynamic memory allocation

Answer :- For Answer Click Here 

4. Java is a platform independent programming language because

a. It compiles an intermediate code targeting a virtual machine, which can be interpreted by an interpreter for a given OS.
b. The Java compiler translates the source code directly into the machine-level language.
c. It follows the concept of “write once and compile everywhere”.
d. It is written almost similar to the English language.

Answer :- 

5. Which of the following is not a Language Processor?

a. Assembler
b. Compiler
c. Interpreter
d. Fortran

Answer :- 

6. A platform is the hardware or software environment in which a program runs. Which of the following
is/are Java platform component(s)?

a. HTML
b. Java Virtual Machine
c. Javascript
d. HotJava

Answer :- For Answer Click Here 

7. What is the correct sequence of steps to execute a Java program?
I. Compile the Program: Use the javac command to compile the code into bytecode.
Il. Edit the Program: Write the code in a text editor or IDE.
III. Run the Program: Use the java command to execute the bytecode.
Which of the following options represents this sequence?

a. Run → Edit → Compile
b. Edit → Run → Compile
c. Compile → Edit → Run
d. Edit → Compile → Run

Answer :- 

8. What is the primary difference between javac and java commands?

a. javac is used to edit Java code, while java runs Java programs.
b. javac compiles Java source code to bytecode, while java executes the bytecode on the JVM.
c. javac executes Java programs, while java is used for compilation.
d. Both are used for compiling Java programs.

Answer :- 

9. Which of the following is not a feature of Java?

a. Platform Independence
b. Object-Oriented Programming
c. Supports Explicit Pointers
d. Supports Polymorphism

Answer :- 

10.

Answer :- For Answer Click Here 

Leave a Comment