Test 2

Test 2

University

50 Qs

quiz-placeholder

Similar activities

EPA-11-DEC-2021 On Java

EPA-11-DEC-2021 On Java

University

50 Qs

Quis Java Gunadarma

Quis Java Gunadarma

University

45 Qs

CMPTR 2L Midterm Exam

CMPTR 2L Midterm Exam

University

55 Qs

Joy of Programming

Joy of Programming

University

50 Qs

Java Quiz Review

Java Quiz Review

University

49 Qs

112 Review

112 Review

University

45 Qs

Internal Exam Quiz

Internal Exam Quiz

University

47 Qs

PF201: SCCPF2012223

PF201: SCCPF2012223

University

50 Qs

Test 2

Test 2

Assessment

Quiz

Computers

University

Hard

Created by

Prof. Wadhwani

Used 2+ times

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is the correct way to declare an array in Java?
int arr[] = new int[5];
int arr = new int[5];
array arr[5];
int arr() = new int[5];

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of: System.out.println(10 + 20 + "Java");
30Java
Java30
1020Java
Java1020

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which keyword is used to inherit a class in Java?
implements
extends
inherit
super

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which operator is used to compare two values in Java?
equals
double equal
!=
slash

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How to find the length of a string in Java?
str.length
str.len()
str.length()
length(str)

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the default value of an int variable in Java?
0
null
undefined
1

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is NOT a primitive data type in Java?
int
boolean
String
double

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?