0% found this document useful (0 votes)
12 views

Chapter 2 Introduction to Java

Uploaded by

souren_mallicl
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Chapter 2 Introduction to Java

Uploaded by

souren_mallicl
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Chapter 2: Introduction to Java

A. Tick () the correct option.


1. What was Java initially called?
a. Oak 
b. C
c. C++
d. None of these

2. What is Java Programming Language?


a. A runtime system
b. A set of development tools.
c. An Application Programming Interface (API)
d. All of these 

3. Name the process that converts source code to bytecode.


a. Interpretation
b. Compilation 
c. All of these
d. None of these

4. A Virtual Processor that is implemented in software and runs using the capabilities provided by your operating
system and computer hardware.
a. Byte Code
b. Compiler
c. Interpreter
d. Java Virtual Machine(JVM) 

5. Which among the following is not a language feature in Java?


a. Robust
b. Secured
c. Platform Independent
d. Procedure Oriented 

6. Name the programs that can be developed in such a way that it remains embedded in a web page and runs on the
viewer’s machine in a secured manner by Java compatible browsers.
a. Applets 
b. Applications
c. Both a and b
d. None of these

7. Name the Application program that is written and compiled which may then be executed in any machine provided
it contains the JVM.
a. Applets
b. Applications 
c. Both a and b
d. None of these

8. What is the extension of a source code in Java?


a. .java 
b. .class
c. Both a and b
d. None of these

9. What is the extension of the byte code in Java?


a. .java
b. .class 
c. Both a and b
d. None of these

10. What is a set of pseudo machine language instructions that are understood by the Java Virtual Machine and are
independent of the underlying hardware called?
a. JVM
b. Source Code
c. Compilation
d. Bytecode 

11. Java applications ...........


a. Are platform dependent
b. Don't need a platform to run
c. Are platform independent 
d. Can't run on Windows

12. JVM stands for ...........


a. Java Visual Monitor
b. Java Video Monitor
c. Java Virtual Monitor
d. Java Virtual Machine 

13. JRE stands for ...........


a. Java Runtime Editor
b. Java Runtime Environment 
c. Java Runtime Expression
d. Java Runtime Enabler

14. Stand-alone Java applications ........... for execution.


a. Need Java-compatible web browser
b. Need an assembler
c. Don't need Java-compatible web browser 
d. Need a linker

15. Java uses ........... for execution.


a. Compiler and interpreter 
b. Interpreter only
c. Compiler only
d. None of these

16. A program that translates code written in a high-level language into machine code is called ...........
a. Assembler
b. Linker
c. Compiler 
d. None of these
17. A program that translates an assembly language program into machine code is called a/an ...........
a. Assembler 
b. Linker
c. Compiler
d. None of these

18. Java is ...........


a. Robust
b. Object oriented
c. Secure
d. All of these 

19. Java can be used to write ...........


a. Stand-alone applications only
b. Both stand-alone and internet applications 
c. Internet applications only
d. None of these

20. Java applications can run on ...........


a. Windows platform
b. Macintosh platform
c. UNIX platform
d. All of these 

B. Fill in the blanks.

1. James Arthur Goslingis called the father of Java programming language.


2. Java was formerly known as Oak.
3. A Java program written in a text editor is called the Source code.
4. Bytecode is a set of pseudo machine language instructions that are understood by the JVM.
5. Java is independent of the underlying hardware and software and is therefore called platform
independent.
6. The process of converting a source code to byte code is called compilation.
7. A platform is the hardware/software environment in which a program remains.
8. The byte code file in Java has the .class extension.
9. JVM is a microprocessor that is implemented in software and runs using the capabilities provided by your
operating
system and computer hardware.
10. Multi-threading is a process of executing multiple threads simultaneously.
11. Java is a case sensitive language.
12. In Java, the package used to find power raised to any base is java.lang.
13. The words which are preserved with the system are called keywords/reserved words, that cannot be
used as variable names in Java programming.
14. A single line comment is represented by the symbol // in Java programming.
15. BlueJ is a window based platform to operate Java program.
C. State whether the following statements are True (T) or False (F).

1. The byte code when compiled gives source code. F


2. A Java program can execute only in Windows machine. F
3. A Java API is a collection of prewritten packages, classes, and interfaces with their respective
T
methods, fields and constructors.
4. Source Code in Java has the .class extension. F
5. Java is simple to learn. T
6. Java application is a Java program which is developed by users. T
7. James Gosling developed Java programming language. T
8. Machine codes are expressed using alphanumeric characters. F
9. Byte code is the program in binary form. T
10. JVM is Java Visual Management. F
11. Stand-alone Java applications cannot run independently on a computer. F
12. A console based Java application is designed to be used via a text-only interface. T
13. Java Applets are Java applications that run within a web browser. T
14. The machine language version of the source code generated by the compilation process is
T
specific to the processor you are compiling on.
15. The Bytecode files are generated with the ".java" extension. F
16. Java uses a combination of compilation and interpretation. T
17. Just-In-Time (JIT) compiler compiles selected portions of Bytecode into executable code. T
18. An interpreter translates the source code instructions into machine code all at once. F
18. JVM stands for Java Virtual Monitor. F
19. Machine language for JVM is called Bytecode. T

You might also like