Java Quiz1 Basics and OOPS

Java Quiz1 Basics and OOPS

Professional Development

10 Qs

quiz-placeholder

Similar activities

Testing and Security

Testing and Security

Professional Development

7 Qs

Set 1: Inquiry- Based Approach in the 21st Century Teaching

Set 1: Inquiry- Based Approach in the 21st Century Teaching

Professional Development

10 Qs

G2 April Standard Quiz

G2 April Standard Quiz

Professional Development

9 Qs

OPV Interface & OPV

OPV Interface & OPV

Professional Development

10 Qs

SAQ on Lung Ultrasound

SAQ on Lung Ultrasound

Professional Development

10 Qs

Day8_Quiz_NBKR

Day8_Quiz_NBKR

Professional Development

10 Qs

Summer Training with Mindset

Summer Training with Mindset

University - Professional Development

10 Qs

Air Supplies

Air Supplies

Professional Development

10 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?

Discover more resources for Professional Development