1.
The Java compiler generates
Correct Answer
B. Bytecode
Explanation
The Java compiler generates bytecode. Bytecode is a low-level representation of the Java source code that can be executed by the Java Virtual Machine (JVM). It is a platform-independent format that allows Java programs to run on any system with a compatible JVM. The bytecode is generated from the source code during the compilation process and is stored in .class files. These .class files can then be executed by the JVM to produce the desired output.
2.
Which of the following features make Java a favourite for internet?
Correct Answer
A. Portability and security
Explanation
Java is a favorite for the internet because of its portability and security features. Portability allows Java programs to run on any platform without the need for recompilation, making it ideal for internet applications that need to be accessible across different devices and operating systems. Additionally, Java's built-in security features, such as the sandbox environment and automatic memory management, help protect against malicious attacks and ensure the integrity of internet applications.
3.
The Java feature, "write once, run anywhere", is termed as
Correct Answer
D. Platform independent
Explanation
The term "write once, run anywhere" refers to the Java feature of being able to write code on one platform and run it on any other platform without the need for recompilation. This means that Java programs can be created on one operating system and then executed on any other operating system that supports Java, making it platform independent.
4.
Which one of the following is true about the Java platform?
Correct Answer
A. Compiler compiles source code to a .class file
Explanation
The Java platform uses a compiler to compile the source code into a .class file. This .class file contains bytecode, which is a low-level representation of the source code that can be understood by the Java Virtual Machine (JVM). The JVM then interprets this bytecode and executes it on the machine. Therefore, the correct answer is that the compiler compiles the source code to a .class file.
5.
The feature of Java which makes it possible to run many jobs simultaneously is known as
Correct Answer
C. Multithreaded
Explanation
Multithreading is a feature in Java that allows multiple threads to run concurrently within a single program. Each thread represents a separate flow of control, allowing multiple tasks to be executed simultaneously. This feature enhances the efficiency and responsiveness of Java programs by enabling concurrent execution of multiple jobs or tasks. Therefore, the correct answer is "Multithreaded".
6.
Javac.exe found in the Java Development Kit (JDK) is known as
Correct Answer
B. Compiler
Explanation
The correct answer is "Compiler" because javac.exe is a tool provided by the Java Development Kit (JDK) that is used to compile Java source code into bytecode. A compiler translates the source code into a lower-level language that can be executed by the computer. Therefore, javac.exe is responsible for converting Java code into bytecode that can be executed by the Java Virtual Machine (JVM).
7.
The location of Java compiler and interpreter in JDK is in
Correct Answer
C. C:\Program Files\Java\jdk1.6.0\bin
Explanation
The correct answer is C:\Program Files\Java\jdk1.6.0\bin. This is the correct location for the Java compiler and interpreter in the JDK (Java Development Kit) installation. The bin folder within the jdk1.6.0 directory contains the executable files for the Java compiler and interpreter, which are necessary for compiling and running Java programs.
8.
What is Java API?
Correct Answer
B. A collection of ready-made software components in Java.
Explanation
The Java API refers to a collection of pre-built software components that are available for use in Java programming. These components provide ready-made functionality and can be easily integrated into Java programs, saving developers time and effort. The Java API includes a wide range of classes and methods that cover various areas such as file handling, networking, database connectivity, user interface development, and more. By utilizing the Java API, developers can leverage the existing codebase and build robust applications efficiently.
9.
Which of the following is true about a Java applet?
Correct Answer
D. All of the above
Explanation
A Java applet is a small program written in Java that can be downloaded from the internet and run on a Java-enabled browser. It is designed to be interactive and can react to user inputs, dynamically changing its behavior or appearance. Therefore, all of the given statements are true about a Java applet.
10.
What are the input and outputs of a Java compiler?
Correct Answer
A. Source code; byte code
Explanation
A Java compiler takes the source code written in Java programming language as input and converts it into byte code. The byte code is a low-level representation of the source code that can be executed by the Java Virtual Machine (JVM). Therefore, the input of a Java compiler is the source code, and the output is the byte code.