WorksheetsJava Test-1
Total questions: 10
Worksheet time: 7mins
Which of the following is not a Java features?
Dynamic
Architecture Neutral
Use of pointers
Object-oriented
Evaluate the following Java expression, if x=3, y=5, and z=10:
++z + y - y + z + x++
24
23
20
25
All Java components require names. Names used for classes, variables, and methods are called?
Variables
identifiers
Access Modifiers
Java Modifiers
Which of the following is not a primitive data type ?
byte
enum
short
int
Character data type cannot store following value.
Digit
Letter
Special Character
String
Modulus operator, %, can be applied to which of these?
Both Integers and floating - point numbers
Integers
Floating - point numbers
None of the mentioned
Evaluate the value of the expression?
6 - 2 + 10 % 4 + 7
14
12
13
10
Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
((x < 100) && (x > 1)) && (x < 0)
((x < 100) && (x > 1)) || (x < 0)
(1 > x > 100) || (x < 0)
1 < x < 100 || x < 0
Which of the following is used to declare,construct, and initlaize an array?
int arr [] [] = {1, 2, 3, 4};
int [] arr = (1, 2, 3)
int [] arr = {};
int arr [] = {1, 2, 3};
In java, array elements are stored in ________ memory locations
Random
Sequential
Sequential & Random
Binary search
