
JAVA

Quiz
•
Computers
•
University
•
Hard

sarala vinayagam
Used 4+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of these access specifiers can be used for an interface?
Public
Protected
Private
All of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of these can be used to fully abstract a class from its implementation?
Object;
Interfaces;
None of the above;
packages
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following is the correct way of implementing an interface salary by class manager?
class manager extends salary{}
class manager implements salary{}
class manager imports salary {}
none of the mentioned
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following is an incorrect statement about packages?
Interfaces specifies what class must do but not how it does
Interfaces are specified public if they are to be accessed by any code in the program
All variables in interface are implicitly final and static
All variables are static and methods are public if interface is defined public
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What will be the output of the following program?
interface calculate
{
void cal(int item);
}
class display implements calculate
{
int x;
public void cal(int item)
{
x = item * item;
}
}
class interfaces
{
public static void main(String args[])
{
display arr = new display;
arr.x = 0;
arr.cal(2);
System.out.print(arr.x);
}
}
0
2
4
none
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What will be the output of the following program?
interface calculate
{
int VAR = 0;
void cal(int item);
}
class display implements calculate
{
int x;
public void cal(int item)
{
if (item<2)
x = VAR;
else
x = item * item;
}
}
class interfaces
{
public static void main(String args[])
{
display[] arr=new display[3];
for(int i=0;i<3;i++)
arr[i]=new display();
arr[0].cal(0);
arr[1].cal(1);
arr[2].cal(2);
System.out.print(arr[0].x+" " + arr[1].x + " " + arr[2].x);
}
}
0 1 2
0 2 4
0 0 4
0 1 4
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following Java built-in interfaces is a functional interface?
Serializable
Comparable
Runnable
Cloneable
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Linux 3-4

Quiz
•
University
20 questions
Programming in C(1)

Quiz
•
University
20 questions
Quiz 1 PBO

Quiz
•
University
15 questions
Round 1 (Tech Utsav)

Quiz
•
University
20 questions
Pemograman Berorientasi Objek (POB)

Quiz
•
University
20 questions
QUIZ DASAR DASAR PEMROGRAMAN JAVA

Quiz
•
11th Grade - University
16 questions
Quiz Pemrograman Java dengan netbeans

Quiz
•
10th Grade - University
15 questions
Quiz Pemrograman Berorientasi Obyek

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University