Java Quiz1 Basics and OOPS

Java Quiz1 Basics and OOPS

Professional Development

10 Qs

quiz-placeholder

Similar activities

Java Lab6

Java Lab6

Professional Development

10 Qs

Day7_Quiz_NBKR

Day7_Quiz_NBKR

Professional Development

10 Qs

Abstract Class

Abstract Class

University - Professional Development

9 Qs

Tech Writing

Tech Writing

Professional Development

15 Qs

Quiz for Jul 20_Connect

Quiz for Jul 20_Connect

Professional Development

10 Qs

PreTrainingWeek3Content

PreTrainingWeek3Content

Professional Development

11 Qs

[FAST TRACK] Android class quiz 10

[FAST TRACK] Android class quiz 10

Professional Development

15 Qs

Java_1

Java_1

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?