Java Quiz1 Basics and OOPS

Java Quiz1 Basics and OOPS

Professional Development

10 Qs

quiz-placeholder

Similar activities

Java Quiz

Java Quiz

KG - Professional Development

8 Qs

MSDM.net Quiz 099

MSDM.net Quiz 099

Professional Development

10 Qs

Quiz for Module2

Quiz for Module2

Professional Development

10 Qs

PreTrainingClassesObjectsMethods

PreTrainingClassesObjectsMethods

Professional Development

10 Qs

INNO_QUIZ_THALIR_9th-oct_CW-41

INNO_QUIZ_THALIR_9th-oct_CW-41

Professional Development

12 Qs

[FAST TRACK] Android Class Quiz week 05 12/05

[FAST TRACK] Android Class Quiz week 05 12/05

Professional Development

15 Qs

Files

Files

Professional Development

10 Qs

Kotlin Fundamentals

Kotlin Fundamentals

Professional Development

7 Qs

Java Quiz1 Basics and OOPS

Java Quiz1 Basics and OOPS

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Surekha Rajeshwari

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output:

int arr[ ] = new int[5];

System.out.println(arr[1]);

1
0
null
garbage value

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output:

package main;

class Main {

public static void main(String args[]) {

int t;

System.out.println(t); } }

0
Garbage Value
complie time error
runtime error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Main {

public static void main(String args[]) {

int arr[] = {10, 20, 30, 40, 50};

for(int i=0; i < arr.length; i++) {

System.out.print(" " + arr[i]);

} } }

10 20 30 40 50
10 20 30 40
complie time error
runtime error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the immediate parent class for Integer, Float and Long classes?
Object Class
Wrapper Class
Number Class
none of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

predict the output:

abstract class Sample{ //Line0

public int a; //Line1

demo(){ //Line2

a=10; //Line3

} }

Line0 : abstract class must be public
Line1: abstract class cannot have instace variables
Line2: demo() Return type for the method is missing
Line3: Illegal initialization

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

predict the output: abstract class Sample{

Sample(){

super(); //Line1

}

abstract final public get(); //Line2

public static void check() { //Line3

System.out.println("Static checking"); } }

Line1: abstract class cannot call super
Line2:Cannot pair abstract final
Line3: abstract class cannot have static methods
all 3 lines are with compile time error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output:

abstract class Sample{

Sample(){

super(); //Line1

}

public final void get() { //Line2

System.out.println(); }

public static abstract void check(); //Line3

}

Line1: abstract class cannot call super
Line2: abstract class cannot have final method
Line3: static and abstract cannot be paired
all 3 lines are with compile time error

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?