Previous | Home | Next |
Introduction to Java Programming
(a). True
(b). False
Answer: (b). False
Explain: JVM (Java Virtual Machine) use's interpreter to convert byte code to machine language at execution time. So Java interpreter is used to execute byte code not source code.
(a). True
(b). False
Answer: (a). True
Explain: When we compile any file then java complier compile it and make a class file with same class extension.
(a). True
(b). False
Answer: (a). True
(a). True
(b). False
Answer: (a). True
Answer: A class and the main( ) method declarations.
Answer: Two parts in executing a Java program are:
- Java Compiler
- Java Interpreter.
The Java Compiler is used for compilation and the Java Interpreter is used for execution of the application.
Answer: Encapsulation, Inheritance and Polymorphism are the three OOPs Principles.
- Encapsulation: Is the Mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
- Inheritance: Is the process by which one object acquires the properties of another object.
- Polymorphism: Is a feature that allows one interface to be used for a general class of actions.
Answer: Java source code file.
System.out.println("// Looks like a comment.");
(a). // Looks like a comment
(b). The statement results in a compilation error
(c). Looks like a comment
(d). No output is displayed
Answer: (a). // Looks like a comment
Q.10 In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true?
(a). It must have a package statement
(b). It must be named Test.java
(c). It must import java.lang
(d). It must declare a public class named Test
Answer: (b). It must be named Test.java
Answer: Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not begin with numbers.
Answer: void
Answer: string array.
Answer: A – Z, a – z, _ ,$
Answer:
-
// -- single line comment
/* --
*/ multiple line comment
/** --
*/ documentation
Answer: Constructor will be automatically invoked when an object is created. Whereas method has to be call explicitly.
Answer: Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib contains all packages and variables
Previous | Home | Next |