
JAVA MCQ TEST-I SLOT L31+L32

Quiz
•
Computers
•
University
•
Medium
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
Similar Resources on Wayground
20 questions
Final Quiz

Quiz
•
University
15 questions
II CSM A & B

Quiz
•
University
20 questions
Fundamentos JAVA

Quiz
•
University
20 questions
TALENT-NEXT-JAVA-QUIZ1

Quiz
•
University
21 questions
Prog Web U3

Quiz
•
University
20 questions
Quiz 2 PBO

Quiz
•
University
20 questions
JAVA Basics Quiz

Quiz
•
University
25 questions
OOPs Fundamentals

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade