Notepad
Notepad
Notepad
-Yes, Because we can call Java compiler from Which of the following is a valid identifier?
notepad
- None of these
What is the correct statement to set JavaC path in
command line? Which of the following is not a Java comment?
Which of the following is true about syntax errors: Which of the following is not a java keyword?
Why do we need to set the path for JavaC in Which of the following is not an escape sequence?
command line?
-None of these
- It is part of the compilation process
Which of the following is not a valid variable
What is the correct statement to run Java program in declaration in Java?
command line?
-float x = 2.0D;
-java HelloWorld
Which of the following a valid Java identifier?
What is the correct statement to compile Java
-All of these
program in command line?
Which of the following is not a valid Float value?
-javac HelloWorld.java
-1.23
What is the extension name of a Java Source code?
Which of the following is not Java Literal?
-java
-None of the above
Which of the following we are not allowed to write java
source code? What did java generates after compiling the java
source code?
-None of these
-Executable file
What will happen if we compile the statement below?
~System.out.println(“Hello World!”) Which of the following is not the feature of java?
JVM is responsible for Which of the following is true about Runtime errors:
What was the initial name for the Java programming The Java feature, "write once, run anywhere", is
language? termed as
-3 -765321
What type of value does the nextLine() returns? Which of the following is a valid multidimensional
array?
- Line
-All of these
What will happen if you use JOptionPane.
showInputDialog statement in your program? What is the output of the code snippet below:
int[] intArray = new int[10];
- The program will display an input dialog box that
allows the user to input text and returns the for(int x = 0; x<intArray.length; x++)
{System.out.print(intArray[x]);}
correct type value.
-0123456789
Which is not a repetition control structure?
Which of the following correctly accesses the sixth
-Switch element stored in an array of 10 elements?
Which statement will check if x is equal to y? -stringArray[5];
- None of these From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what
is the value of intArray[3]?
What will be the value of x after you execute this
statement
-5
int z=0; for(int x=0; x<10; x++) for(int y=0; y<x; y++)
z*=(x*y); Which of the following declares an array of int named
- None of these intArray?
Which of the following has the correct form for an if -int[] intArray;
statement?
What is the maximum index of the array: int[] intArray
- if (boolean_expression) = { 1, 2, 3, 5, 6, 7 };
What will be the output if you execute this code?
-5
do{System.out.println("Hello World!");}while(true);
-print "Hello World" infinitely What is the index number of the last element of an
array with 30 elements?
Which of the following is a valid statement to accept
String input? -29
-String str = scan.nextString(); What will be the output if you execute this code?
do{System.out.println("Hello World!");}while(false);
-Do nothing Which of the following is a valid nextInt() return value?
What will be the value of x after executing this code - All of these
for(int x=0; x<=10; x++) {} is run? Which of the following show casting object?
-10
- All of the choices
It is a template for creating an object? Which of the following method is allowed to be
overriden?
- Object Oriented
- None of these
Which of the following creates an instance of a class?
What keyword is used to perform class inheritance?
- All of the choices
- extends
What will be the value of x if we execute this: String s
= "25"; int x = Integer.parseInt(s); ? Which of the following class declaration is not allowed
to be inherited?
- The code is not valid.
- None of these
It is the method of hiding certain elements of the
implementation of a certain class? It is the ability of an object to have many forms?
- Encapsulation - Polymorphism
What do you call a blueprint of an object? What do you call a class that inherits a class?
- Class - Subclass
What is the result if we execute this: “a” instanceof What is the index number of the last element of an
String; ? array with 20 elements?
-False -19
What is the result if we execute this: “a”.equals(“a”);? what will be the output if you execute this code?
int x=2;
- true
switch(x){
Which of the following is true about Interface?
case 1:
- It defines the signatures of a set of methods System.out.print(“1”);
without the body case 2:
Which of the following is the correct way to define an System.out.print(“1”);
interface? case 3:
- public interface [InterfaceName] {} System.out.print(“1”);
default:
Which of the following is the correct way to use an
interface? System.out.print(“1”);
}
- public class Person use [InterfaceName] {}
- display 1
Which of the following is the correct way to call the
constructor of the parent class? Which of the following is a valid editor for java source
code?
- this.call()
- All of the choices
Which of the following class declaration is not allowed
to be instantiated? From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what
is the value of intArray[2]?
- class Person{}
-2
Which of the following is true about constructor?
- Generating bytecode
- Instance Variable
- method