JAVA MCQ TEST-I SLOT L31+L32

JAVA MCQ TEST-I SLOT L31+L32

University

20 Qs

quiz-placeholder

Similar activities

CES JAVA

CES JAVA

University

20 Qs

Introduction to Java

Introduction to Java

University

25 Qs

Java Quiz 4

Java Quiz 4

University

15 Qs

Java, part I

Java, part I

11th Grade - University

20 Qs

Java Quiz 1

Java Quiz 1

University

20 Qs

Data Types Java Concepts

Data Types Java Concepts

University

19 Qs

Basic Java

Basic Java

University

15 Qs

Java Bootcamp Day 4

Java Bootcamp Day 4

University

15 Qs

JAVA MCQ TEST-I SLOT L31+L32

JAVA MCQ TEST-I SLOT L31+L32

Assessment

Quiz

Computers

University

Medium

Created by

SRINIVASARAO 22PHD7042

Used 10+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Creating an object from a class is also called ____.

Initializing

Instantiating

Interfacing

NONE

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way of converting an int value to Integer in below Java code?

Integer in = new Integer(9);

Integer in = Integer.valueOf(9);

Integer in = new Integer("9");

NONE

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct syntax of a Java Package below.

package PACKAGE_NAME;

package PACKAGE_NAME.*;

pkg PACKAGE_NAME;

pkg PACKAGE_NAME.*;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a package in Java?

A Package is a collection of files of type Java Class, Interfaces, or Abstract Class

A Package is simply a Directory or Folder with Java Classes

A Package usually contains Java Classes written for a specific purpose or problem

All the above

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the below Java program with an Interface?

interface Car {

int basePrice=1000; }

public class InterfaceTest2 implements Car {

void changePrice() {

basePrice = 2000;

System.out.print(basePrice); }

public static void main(String[] args) {

new InterfaceTest2().changePrice(); } }

1000

2000

COMPILE TIME ERROR

NONE

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An interface in Java is like a 100% ____.

abstract class

public class

inner class

anonymous class

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the below Java program

class Sweet {

void price() {

System.out.print("Sweet=$10 "); } }

class Sugar extends Sweet {

void price() {

super.price(); System.out.print("Sugar=$20"); } }

public class JavaInheritance1 {

public static void main(String[] args) {

Sugar su = new Sugar();

su.price(); } }

Sweet=$10 Sugar=$20

Sweet=$10 Sugar=$10

Sweet=$20 Sugar=$20

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