0% found this document useful (0 votes)
33 views

Java Fundamental Assessment

Uploaded by

Gulab khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Java Fundamental Assessment

Uploaded by

Gulab khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

5/31/24, 8:08 PM Java Fundamental Assessment

 D

Assessment Name - Java Fundamental Assessment ATTEMPTS LEFT - 1


 M
RETAKE ASSESSMENT (HTTPS://WINGZ.ITVEDANT.COM/INDEX.PHP/ASSIGNMENT-TEST-STUDENT/RETAKE-TEST?ID=145157)

 P
Total Questions - 50 Score - (34 / 50) 68%
 3

I
1) JRE stands for ?
 Q A) Java Development Kit 0M
B) Java Virtual Machine
J C) Java Run-time Environment
 D D) None of Above

R 2) Java has how many primitive data types?


 J A) 7 0M
B) 8
 C
C) 9
D) None of these
 F

3) Which is a valid keyword in Java?


 R
A) new 1M
B) delete
C) both
D) None of these

4) An ELSE statement must be preceded by ____ statement in Java.


A) IF 1M
B) ELSE IF
C) IF or ELSE IF
D) None

5) Java identifiers should not start with?


A) UpperCase Character 1M
B) LowerCase Character
C) Digit
D) Underscore

6)

Find the output of the given Java program?

public class Main {


public static void main(String args[]) {
System.out.println("Hello World ");
System.out.println("Hello Know Program");
}
}

A) Hello World 1M
B) Know Program
C) Hello World Hello Know Program
D) Hello World Hello Know Program

7)

What is the output of the given below program?

public class Main {


public static void main(String args[]) {
System.out.println("Hello "" World");
}
}

A) Hello World 0M
B) HelloWorld
C) Compiled Successfully, No Output.
https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 1/7
5/31/24, 8:08 PM Java Fundamental Assessment

D) Compile-time error

8) Which is an invalid keyword in Java?


A) byte 1M
D B) Short

C) int
 M D) long

P
9) Find Invalid Java keyword?

A) break 1M
3 B) continue

C) return
I D) exit
 Q
10) Find an invalid Java keyword?
J A) instanceof 1M
 D B) sizeof
C) strictfp
R
 D) None of these
J

11) Find the valid Java keywords?


C
 A) null 0M
B) true
 F
C) false
D) None of these
 R

12) Which of the following is a reserved keyword in Java?


A) object 1M
B) strictfp
C) main
D) system

13) Which of the following can’t be used as a Java identifier?


A) String 0M
B) Int
C) main
D) long

14)

Find the output of the below program?

public class Test {


public static void main(String[] args) {
int height = 9;
int Height = 10;
System.out.println(Height);
}
}

A) 9 0M
B) 10
C) 19
D) Compile-time error

15)

What is the output of the below program?

public class Test {


public static void main(String[] args) {
int abcdefghijklmnopqrstuvwxyz012345 = 6;
System.out.println(abcdefghijklmnopqrstuvwxyz012345);
}
}

A) 0 0M
B) 6
C) Compile-time error
D) Exception

https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 2/7
5/31/24, 8:08 PM Java Fundamental Assessment

16) The allowed values for the boolean data type are?
A) True 0M
B) False
C) true
 D D) null

 M 17) Integer zero (0) is not the default value of which data type?
A) double 1M
 P B) byte
C) short
 3 D) long

I 18) In Java size of int data type is?


 Q A) 2 bytes in 16-bit processor 1M
B) 4 bytes in 16-bit/32-bit processor
J
 C) 4 bytes in all systems
D
D) None of these
R
 19) Which of the following is false?
J
A) double d = 97.5d; 0M
C
B) double d = 97.5D;

C) double d = 97.5F;
 F D) None of these

20) Which of the following is invalid?


 R
A) float f1 = 10; 1M
B) float f2 = ‘a’;
C) float f3 = 9.9;
D) float f4 = 9.5F;

21) Which of the following is valid?


A) char ch1 = true; 1M
B) char ch2 = 97;
C) char ch3 = 65536;
D) char ch4 = 97.0;

22)

Find the output of the below Java program?

class Test{
public static void main(String[] args) {
char ch1 = 97;
char ch2 = -98;
System.out.println(ch1+".."+ch2);
}
}

A) 97..98 0M
B) a..b
C) a..-b
D) None of these

23) Every IF statement must be followed by an ELSE of ELSE-IF statement.


A) True 1M
B) False
C) -
D) -

24) Find the output of the given Java program?

public class Main

public static void main(String[] args) {

https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 3/7
5/31/24, 8:08 PM Java Fundamental Assessment

if(1>3)

System.out.println("Know Program");

}
 D
}
A) Know Program
 M 1M
B) Other Output

P
C) Compiled Successfully, No Output.

D) Compile-time error

 3
25)

I
What is the output of the below program?
 Q
public class Main
J {
 D public static void main(String[] args) {
int a = 25;
if(a < 5)
R
System.out.println("Hi");
 J if(a < 20)
System.out.println("Hello");
C else

System.out.println("Know Program");
}
 F
}

 R A) Hi 0M
B) Hello
C) Know Program
D) Compiled Successfully, No Output.

26) What is the maximum number of ELSE-IF statements that can be present in between starting IF and
ending ELSE statements?
A) 32 1M
B) 64
C) 128
D) None

27) Which of these selection statements test only for equality?


A) if 1M
B) switch
C) if & switch
D) none of the mentioned

28) An ELSE or ELSE-IF statement in Java can not exist alone without an IF statement.
A) True 1M
B) False
C) -
D) -

29)

What is the output of the given below program?

public class Main


{
public static void main(String[] args) {
float a = 7.3f;

if(a == 7.3)
System.out.print("Hi");
else
System.out.print("Know Program");
}
}

A) Hi 0M
B) Know Program
C) Compiled Successfully, No Output.
D) Compile-time error

https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 4/7
5/31/24, 8:08 PM Java Fundamental Assessment

30)

Find the output of the given Java program?

public class Main


 D {
public static void main(String[] args) {
double a = 7.3;
 M

if(a = 7.3)
 P System.out.print("Hi");
else
3 System.out.print("Know Program");

}
}
I
 Q
A) Hi 1M
B) Know Program
J
 D C) Compiled Successfully, No Output.
D) Compile-time error
R
 J 31)

What is the output of the given below program?


 C

public class Main {


 F public static void main(String[] args) {

boolean x = true;
 R
boolean y = false;
boolean z = true;

if(x && y || y && z)


System.out.print("Hi");
else
System.out.print("Know Program");
}
}

A) Hi 0M
B) Know Program
C) Compiled Successfully, No Output.
D) Compile-time error

32)

Find the output of the given Java program?

public class Main {


public static void main(String[] args) {

boolean x = true;
boolean y = false;
boolean z = true;

if(x & y | y & z | z)


System.out.print("Hi");
else
System.out.print("Know Program");
}
}

A) Hi 0M
B) Know Program
C) Compiled Successfully, No Output.
D) Compile-time error

33)

What is the output of the below Java code snippet?


int a = 2 - - 7;
System.out.println(a);

A) -5 0M
B) 10
C) 9
D) Compiler Error
https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 5/7
5/31/24, 8:08 PM Java Fundamental Assessment

34) How many minimum number of operands are required to use Comparison operators in Java?
A) 1 1M
B) 2
C) 3
 D D) 4

 M 35) What is Java Virtual Machine (JVM)?


A) It is a physical machine and a specification which provides runtime environment for java 1M
 P bytecode execution.
B) It is an abstract machine and a specification which provides runtime environment for java
 3 bytecode execution.
C) It is a abstract machine and a implementation which provides runtime environment for java
I
 sourcecode compilation.
Q
D) It is a physical machine and a implementation which provides runtime environment for java
J sourcecode compilation.
 D
36) Having compiled source code, It converts to another code called?
R
A) Byte code 1M
 J B) Executable code
C) Binary code
 C D) -

 F 37) What is the Java Classloader?


A) It dynamically loads Java source code into the JVM. 1M
 R B) It dynamically loads Java resources into the JVM.
C) It dynamically loads Java classes into the JVM.
D) -

38) What are the main operations of JVM?


A) 1) To load code 2) To compile code 3) To executes code 4) To provide runtime environment. 1M
B) 1) To compile code 2) To load code 3) To Executes code 4) To provide runtime environment.
C) 1) To debug code 2) To compile code 3) To Executes code 4) To provide runtime environment.
D) 1) To load code 2) To Verify code 3) To Executes code 4) To provide runtime environment.

39) Platform independent code file created from Source file is understandable by 1M
A) JRE.
B) JVM
C) Applet
D) Complier

40) What is a Java development kit (JDK) ?


A) It is a set of libraries with a Java runtime environment. 1M
B) It is a just development tool.
C) It is a development tool with a Java runtime environment.
D) It is a just runtime environment.

41) Which are the unary operators ?


A) ++ 1M
B) --
C) Both of above
D) -

42) Which are the arithmetic operators ?


A) * / % 1M
B) + -
C) All of above
D) -

43) Which are the bitwise operators ?


A) & 1M
B) ^
C) |
D) All of Above

44) Which are the logical operators ?


A) && 0M
B) ||
https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 6/7
5/31/24, 8:08 PM Java Fundamental Assessment

C) All of above
D) None of Above

45) Which are the assignment operators ?


D A) = += -= *= /= %= 1M

B) &= ^= |=
 M C) <<= >>= >>>=
D) All of Above
 P
46) Which data type is used to store a single character in Java? 1M

 3 A) char
B) String
I C) int
 Q D) single

J 47) Which of the following is not a Java features? 1M


 D A) Dynamic
B) Architecture Neutral
R
 C) Use of pointers
J
D) Object-oriented
C
 48) Which of the following is the correct way to declare multiple variables of the same type? 1M
A) int a; int b; int c;
 F
B) int a, b, c;
C) int a, b = 5, c;
 R
D) All of the above

49) Which operator is used in Java for addition? 1M


A) *
B) +
C) /
D) %

50) What is the purpose of the continue statement in a loop? 1M


A) To exit the loop immediately
B) To skip the current iteration and move to the next iteration
C) To terminate the program
D) To execute a specific block of code

https://wingz.itvedant.com/index.php/assignment-test-student/exam-view-topic?id=9535&isMessageDisplayed=1 7/7

You might also like