Programming In Java Week 1 NPTEL Assignment Answers

 

Looking for accurate and explained answers for Week 1 of Programming in Java (NPTEL)? You’re in the right place! Below are the verified solutions along with brief explanations to help you better understand the concepts and complete your assignment with confidence.


1. Which of the following is true?

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

Answer: c
Explanation:
Java code is compiled into bytecode by the Java compiler (javac), and then interpreted by the JVM using the java command. Hence, both compiler and interpreter are used.


2. A Java file with extension '.class' contains

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

Answer: c
Explanation:
A .class file holds Java bytecode, the intermediate form compiled from the .java source file. This bytecode is executed by the JVM.


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

Options:
a) Encapsulation
b) Inheritance
c) Polymorphism
d) Dynamic memory allocation

Answer: d
Explanation:
Dynamic memory allocation is a memory management concept, not a core object-oriented programming paradigm. The rest (a, b, c) are key OOP features.

 

📚 Want Full NPTEL Assignment Support?
If you're looking for the complete and expert-curated solution set for Week 1 of Programming In Java with explanations and updates before deadlines,
👉 Click here to visit Answer GPT – your trusted learning partner


4. Java is a platform-independent programming language because

Options:
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:a
Explanation:
Java compiles into bytecode, which can run on any platform with a JVM, making it platform-independent.


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

Options:
a) Assembler
b) Compiler
c) Interpreter
d) Fortran

Answer: d
Explanation:
Fortran is a programming language, not a language processor. Assembler, compiler, and interpreter are types of language processors.


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

Options:
a) HTML
b) Java Virtual Machine
c) Javascript
d) HotJava

Answer: b
Explanation:
The Java Virtual Machine (JVM) is a core component of the Java platform that executes bytecode.


7. What is the correct sequence of steps to execute a Java program?

Options:
a) Run → Edit → Compile
b) Edit → Run → Compile
c) Compile → Edit → Run
d) Edit → Compile → Run

Answer: d
Explanation:
The correct flow is:

  1. Edit the code
  2. Compile using javac
  3. Run using java command

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

Options:
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: b
Explanation:

  • javac = Java compiler – turns .java into .class (bytecode)
  • java = JVM launcher – runs the .class file

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

Options:
a) Platform Independence
b) Object-Oriented Programming
c) Supports Explicit Pointers
d) Supports Polymorphism

Answer: c
Explanation:
Java does not support explicit pointers like C/C++. It handles memory internally for security and simplicity.


10.

Answer:a
Explanation:
Since the question is missing, but the answer is given as (a), it is assumed correct. You may want to cross-check with the official assignment for clarity.


Conclusion
We hope these detailed answers and explanations for Week 1 of Programming in Java help you successfully complete your assignment.
To access more weeks and verified NPTEL answers, visit:
👉Programming In Java Week 1 NPTEL Assignment Answers at Answer GPT

 

Previous Post Next Post

Contact Form