KEMBAR78
Test For Java | PDF | Java (Programming Language) | Java Virtual Machine
0% found this document useful (0 votes)
4 views4 pages

Test For Java

The document is a test for Java programming, consisting of multiple-choice questions covering various topics such as Java's history, syntax, data types, and basic programming concepts. It includes practical programming tasks that require the creation of Java programs for a calculator, user-defined table, half pyramid, and Fibonacci series. The test assesses knowledge of Java fundamentals and coding skills.

Uploaded by

zehersir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Test For Java

The document is a test for Java programming, consisting of multiple-choice questions covering various topics such as Java's history, syntax, data types, and basic programming concepts. It includes practical programming tasks that require the creation of Java programs for a calculator, user-defined table, half pyramid, and Fibonacci series. The test assesses knowledge of Java fundamentals and coding skills.

Uploaded by

zehersir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: __________________________ Date: ______________________

Test for Java


1. Who developed the Java programming language?
a. Microsoft
b. Oracle
c. Sun Microsystems
d. Google
2. In which year was the first version of Java released? In which year was
the first version of Java released?
a. 1991
b. 1995
c. 1998
d. 2000
3. What does JVM stand for?
a. Java Version Machine
b. Java Virtual Mechanism
c. Java Verified Module
d. Java Virtual Machine
4. Which of the following is responsible for converting bytecode into machine
code?
a. JDK
b. JRE
c. JVM
d. Java Compiler
5. What does JDK include?
a. Only a compiler
b. Only a runtime environment
c. Both a compiler and a runtime environment
d. None of the above
6. What is the primary function of JRE?
a. Compilation
b. Debugging
c. Execution
d. Development
7. In escape sequence the backslash (\) glued with a character is called as
a. Control sequence
b. Control specifier
c. Control Method
d. Escape Sequence
8. Which of the following begins with a percent character (%) and terminate
with a “type character, ”
a. Escape Sequence
b. Format Specifier
c. Class
d. Method
9. Scanner is ?
a. an object
b. a class
c. a variable
d. an escape sequence
10. Which of the following is the correct way of declaring a scanner?
a. Scanner sc=new Scanner(System.In);
b. Scanner sc=new Scanner(System.in);
c. Scanner sc=New Scanner(System.in);
d. scanner sc=new scanner(System.in);
11. Which method is used to get the length of Strings?
a. str.len();
b. str.Length();
c. str.length();
d. str.getlength();
12. choice the correct answer
a. str.Replace("x","i")
b. str.replace('x','i');
c. str.replace();
d. none of the above
13. Which of the following is incorrect.
a. System.out.print()
b. System.out.println()
c. System.out.printf()
d. system.out.print()
14. Is this correct?
char character = myObj.next().charAt(0);
a. Yes
b. No
15. What does the method replace returns
a. Integer
b. Boolean
c. Character
d. String
16. Which of the following is used to get the string in a user defined variable?
a. nextInt
b. nextLine
c. nextString
d. nextstring
17. Which of the following is is the correct way of using integer format
specifier?
a. %d
b. %int
c. /d
d. %i
18. What is the default value of the int data type?
a. 0
b. 1
c. Null
d. Undefined
19. Which of the following is a unary operator?
a. +
b. ++
c. –
d. All of the above

20. Which operator is used for logical "AND" operation?


a. &&
b. &
c. ||
d. |
21. How many bits does the long data type use?
a. 8
b. 16
c. 32
d. 64
22. What is the result of the expression "Java" + "Programming"?
a. JavaProgramming
b. Java Programming
c. Java-Programming
d. JavaProgramming-
23. What is the size of the float and double in Java?
a. 32 and 64
b. 64 and 32
c. 16 and 32
d. 32 and 32
24. In Java, which of these access specifiers has the most restrictive access?
a. Private
b. Protected
c. Public
d. Default
25. Which of these is a valid entry point for a Java application?
a. public static void start(String[] args)
b. public void main(String[] args)
c. public static void main(String[] args)
d. public static int main(String[] args)
26. What does the 'static' keyword in Java signify?
a. The method or variable belongs to the class and can be accessed directly
b. The method or variable belongs to the instance of a class
c. The method or variable is constant and cannot be changed
d. There is no need to create an object to invoke the static method.
27. Which of these is a valid declaration of a char in Java?
a. char ch = 'xaa';
b. char ch = 'x';
c. char ch = '\ua432';
d. None of the above
28. The fundamental building blocks of the program are
a. Tokens
b. Object
c. Compil
d. None of the above
29. Make a program for calculator in java(Practical)?
30. Make a user defined table in java (Practical)?
31. Make a half pyramid in java (practical)?
32. Print a fibanacci series(practical)?

You might also like