Java programming - Java test

Java programming - Java test


1) Which specification that provides runtime environment in which java byte code can be executed?

A) JDK
B) JVM
C) JRE
D) None of the above

View Answer / Hide Answer

ANSWER: B) JVM




2) Java language was initially called as "OaK"?

A) True
B) False
View Answer / Hide Answer

ANSWER: True




3) Which is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser?

A) An Applet
B) An Application
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: An Applet




4) Which provides a new way for your programs to interface with code libraries written in other languages?

A) JNI
B) JDBC
C) RMI
D) GUI
View Answer / Hide Answer

ANSWER: JNI




5) Which are used to produce a programming environment that supports the development of far more robust and scalable programs than does the process-oriented model?

A) Polymorphism, Encapsulation, and Inheritance
B) Encapsulation and Inheritance
C) Polymorphism and Encapsulation
D) Inheritance and Polymorphism
View Answer / Hide Answer

ANSWER: Polymorphism, Encapsulation, and Inheritance




6) Which allows you to migrate your implementations over time without breaking the code that depends on the public interface of your classes?

A) Polymorphism
B) Inheritance
C) Encapsulation
D) Both A & B
View Answer / Hide Answer

ANSWER: Encapsulation




7) The comment must begin with /* and end with */ is known as?

A) Multiline comment
B) Single line comment
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: Multiline comment




8) Which is nothing but a blueprint or a template for creating different objects which defines its properties and behaviours?

A) An Array
B) A class
C) Interface
D) None of the above
View Answer / Hide Answer

ANSWER: A class




9) In this type one super-class is having more than one sub-class?

A) Hierarchical inheritance
B) Single inheritance
C) Multiple inheritances
D) Multilevel inheritance
View Answer / Hide Answer

ANSWER: Hierarchical inheritance




10) An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions?

A) True
B) False
View Answer / Hide Answer

ANSWER: True




11) Which symbol Used to contain the values of automatically initialized arrays. Also used

To define a block of code, for classes, methods, and local scopes?

A) Brackets
B) Braces
C) Parentheses
D) Semicolon
View Answer / Hide Answer

ANSWER: Braces




12) Which data type has this Minimum and Maximum value 3.4e-038 to 3.4e+038?

A) long
B) Int
C) Byte
D) Float
View Answer / Hide Answer

ANSWER: Float




13) Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed?

A) Local variables
B) Instance variables
C) Class Variables
D) Static variables
View Answer / Hide Answer

ANSWER: Instance variables




14) In the following statements which is a Disadvantage of Java Array?

A) An array can hold primitive types data
B) An array has its size that is known as array length
C) An array knows only its type that it contains. Array type is checked at the compile-time
D) An array holds only one type of data
View Answer / Hide Answer

ANSWER: An array holds only one type of data




15) In java control statements break, continue, return, try-catch-finally and assert belongs to?

A) Selection statements
B) Loop Statements
C) Transfer statements
D) None of the above
View Answer / Hide Answer

ANSWER: Transfer statements




16) What output you will get if you run this program?
class Modulus {
public static void main(String args[]) {
int x = 42;
double y = 42.25;
System.out.println("x mod 10 = " + x % 10);
System.out.println("y mod 10 = " + y % 10);
}
}

A) x mod 10 = 2
y mod 10 = 2.25

B) x mod 10 = 4
y mod 10 = 2.50

C) x mod 10 = 6
y mod 10 = 3.25

D) x mod 10 = 2
y mod 10 = 4.25
View Answer / Hide Answer

ANSWER: A)




17) The Java Virtual Machine is the cornerstone of the Java platform?

A) True
B) False
View Answer / Hide Answer

ANSWER: True




18) Which is used for Java Virtual Machine "assembly language", its opcodes and operands, as well as items in the Java Virtual Machine's run-time data areas?

A) ASCII
B) Italic
C) Latin
D) Greek
View Answer / Hide Answer

ANSWER: Italic




19) JVM stands for?

A) Java Very Large Machine
B) Java Verified Machine
C) Java Very Small Machine
D) Java Virtual Machine
View Answer / Hide Answer

ANSWER: Java Virtual Machine




20) Who is also called father of Java Programming Language?

A) James Gosling
B) Ken Thompson
C) Dennis Richie
D) None of the above
View Answer / Hide Answer

ANSWER: James Gosling




21) Java Virtual Machine is platform independent?

A) True
B) False
View Answer / Hide Answer

ANSWER: False




22) Switch is more efficient than nested if or if - else in java?

A) True
B) False
View Answer / Hide Answer

ANSWER: True




23) Which statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression?

A) If
B) Switch
C) Nested-if
D) if-else-if
View Answer / Hide Answer

ANSWER: Switch




24) The data type int ranges from one of the following value?

A) –2,147,483,648 to 2,147,483,647
B) -2,147,483,647 to 2,147,483,648
C) -32,768 to 32,767
D) -32,767 to 32,768
View Answer / Hide Answer

ANSWER: –2,147,483,648 to 2,147,483,647




25) Give the Output for the following program?
class Char {
public static void main(String args[]) {
char ch1, ch2;
ch1 = 88; // code for X
ch2 = 'Y';
System.out.print("ch1 and ch2: ");
System.out.println(ch1 + " " + ch2);
}
}

A) ch1 and ch2: X Y
B) ch1 and ch2: x y
C) ch1 and ch2: 1 3
D) None of the above
View Answer / Hide Answer

ANSWER: ch1 and ch2: X Y




26) The following main tasks are performed by?
- Loads code
- Verifies code
- Executes code
- Provides runtime environment

A) JVM
B) JDK
C) JRE
D) Both B & C
View Answer / Hide Answer

ANSWER: A) JVM



Post your comment

    Discussion

  • RE: Java programming - Java test -Trailokya (03/18/16)
  • very good and easy
  • RE: Java programming - Java test -Bhushan pal (12/31/15)
  • Nice
  • RE: Java programming - Java test -kavya chittineni (12/28/15)
  • very useful
  • RE: Java programming - Java test -Mounika (10/28/15)
  • Super....it's help to revise the basics
  • RE: Java programming - Java test -polkamwad jagan (10/25/15)
  • in the above question are good to improve smallest concept
  • RE: Java programming - Java test -polkamwad jagan (10/25/15)
  • in the above question are good to improve smallest concept
  • RE: Java programming - Java test -Mamta (08/21/15)
  • good and very helpful to improvre the baisc knowleadge in java
  • RE: Java programming - Java test -Shashidhar (08/15/15)
  • It's very much helpful
  • RE: Java programming - Java test -daisy ondwari (08/03/15)
  • I found the helpful in boosting my knowledge on the java basics
  • RE: Java programming - Java test -rajeswari (04/02/15)
  • its very useful simple basics of java but we need explanation for easy understanding
  • RE: Java programming - Java test -GALLA BABY (02/24/15)
  • Nice..... it is very useful to improve the java basic knowledge
  • RE: Java programming - Java test -saritha (02/21/15)
  • these questions helps me alot..thnq for postng
  • RE: Java programming - Java test -mahesh Ghatage (09/24/14)
  • Nice Questions Its Very usefull For build up basic knoledgw