MBOSE Class X Computer Science · Chapter 11
Introduction to Java
Live nowWhere Java came from, what makes it special, and how source code becomes bytecode that runs on the Java Virtual Machine.
18 lessons · 110 practice questions
What this chapter covers
- History and goals of Java
- Features
- Source code, bytecode, JVM and the hotspot compiler
- Javac and java
- JDK and JRE
- Compilation unit
- Structure of a Java program
- Main() and void
- Comments
- Applications and applets
- J2SE, J2EE, J2ME
- Servlets, JSP, JavaBeans, JDBC
- IDEs
- Java and C++ compared
Key terms
- source code
Meaning: the program written by the programmer
Example:
Hello.java- compilation unit
Meaning: a Java source file
Example:
Hello.java- bytecode
Meaning: platform-independent code made by javac
Example:
Hello.class- javac
Meaning: the Java compiler
Example:
javac Hello.java- java
Meaning: the Java execution (launcher) command
Example:
java Hello- JVM
Meaning: software machine that runs bytecode
- hotspot compiler
Meaning: JIT compiler in the JVM giving native code
- native code
Meaning: machine instructions of a particular computer
- JRE
Meaning: JVM + libraries to run programs
- JDK
Meaning: JRE + tools to develop programs
- applet
Meaning: small Java program inside a web page
- servlet
Meaning: Java program on a web server
Important questions with answers
10 of the 110 questions on this chapter, solved.
Question 1 · Multiple choice · 1 mark
Java was developed by
- (a) James Gosling
- (b) Bjarne Stroustrup
- (c) Dennis Ritchie
- (d) Tim Berners-Lee
Answer: (a) James Gosling
At Sun Microsystems (SSLC 2024, Q15(d)).
Question 2 · Multiple choice · 1 mark
The extension of a Java source file is
- (a)
.exe - (b)
.class - (c)
.cpp - (d)
.java
Answer: (d)
.javaCompiling it creates a
.classfile.- (a)
Question 3 · Multiple choice · 1 mark
staticbeforemainmeans it can be called- (a) only by other classes
- (b) only once a day
- (c) without creating an object
- (d) only after compiling twice
Answer: (c) without creating an object
The JVM calls main before any object exists.
Question 4 · Multiple choice · 1 mark
______ is used for creating dynamic web pages in Java.
- (a) JDBC
- (b) JavaBean
- (c) J2EE
- (d) JSP
Answer: (d) JSP
MBOSE SSLC 2022, Q1(g).
Question 5 · Assertion and reason · 1 mark
Assertion (A): Java programs can run on any operating system with a JVM.
Reason (R): javac converts source code into platform-independent bytecode.
- (a) Both A and R are true, and R is the correct explanation of A.
- (b) Both A and R are true, but R is not the correct explanation of A.
- (c) A is true, but R is false.
- (d) A is false, but R is true.
Answer: (a) Both A and R are true, and R is the correct explanation of A.
SSLC 2026, Q46.
Question 6 · Short answer · 2 marks
What is the purpose of the keyword void in Java?
Answer
It shows that a method returns no value, e.g.
public static void main(String[] args).Question 7 · Short answer · 2 marks
What is JDBC?
Answer
Java Database Connectivity: methods for querying and updating data in a database.
Question 8 · Short answer · 3 marks
Explain three features of Java.
Answer
Platform independent (bytecode on any JVM); secure (runs in the JVM, no pointers); robust (strong checking, garbage collection).
Question 9 · Long answer · 5 marks
Explain any five features of Java.
Answer
Simple: easy to learn, no pointers. Object-oriented: everything is in classes and objects. Platform independent: bytecode runs on any JVM. Secure and robust: runs in the JVM with strong checking and garbage collection. Multithreaded and distributed: does many tasks at once and works across networks.
Question 10 · Long answer · 5 marks
Explain the JVM, JRE and JDK.
Answer
The JVM is the software machine that runs bytecode. It loads, verifies and executes it, using the hotspot compiler for native code. It also manages memory and security. The JRE is the JVM plus the class libraries, needed to run programs. The JDK is the JRE plus tools such as javac, needed to develop programs.
Study the whole chapter
18 step-by-step lessons, all 110 practice questions with hints, flashcards and mock tests for MBOSE Class X Computer Science.