0% found this document useful (0 votes)
37 views12 pages

Finals Q1 Q2 ITE6104 Computer Programming 2

This document contains two quizzes from a computer programming course on object-oriented programming in Java. The first quiz contains 10 multiple choice questions testing concepts like classes, objects, inheritance, and polymorphism. The second quiz contains another 10 multiple choice questions on related object-oriented concepts like inheritance, interfaces, abstract classes, and polymorphism.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views12 pages

Finals Q1 Q2 ITE6104 Computer Programming 2

This document contains two quizzes from a computer programming course on object-oriented programming in Java. The first quiz contains 10 multiple choice questions testing concepts like classes, objects, inheritance, and polymorphism. The second quiz contains another 10 multiple choice questions on related object-oriented concepts like inheritance, interfaces, abstract classes, and polymorphism.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

UGRD-ITE6104 Computer Programming 2

1. Home
2. My courses
3. UGRD-ITE6104-2023T
4. Week 9-10: Basic Java Object Oriented Programming (Part 1)
5. Final Quiz 1

Question 1
Answer saved
Marked out of 1.00

Flag question

Question text
What do you call a blueprint of an object?
Select one:
a.
Method
b.
None of these
c.
Class
d.
Constructor
e.
Object
Clear my choice

Question 2
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following creates an instance of a class?
Select one:
a.
String str = new String();

b.
Test t = new Test();

c.
Object obj = new Object();

d.
String str = new String();

e.
All of the choices

Clear my choice

Question 3
Answer saved
Marked out of 1.00

Flag question

Question text
What is the result if we execute this: “a”.equals(“a”);?
Select one:
a.
The code is not valid
b.
false
c.
true
d.
None of these
e.
“a”
Clear my choice

Question 4
Answer saved
Marked out of 1.00
Flag question

Question text
Which of the following will do implicit cast?
Select one:
a.
Object obj = new Object();

b.
short x=1; int y = x;

c.
All of these

d.
String x = “0”; int y = x;

Clear my choice

Question 5
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following show casting object?
Select one:
a.
(className) object;

b.
Employee emp = new Employee(); VicePresident veep = new VicePresident(); veep
= (VicePresident)emp;

c.
SuperClass sc = new SuperClass(); SubClass sbc = new SubClass(); sbc =
(SubClass) sc;

d.
All of the choices

Clear my choice

Question 6
Answer saved
Marked out of 1.00

Flag question

Question text
It is a template for creating an object?
Select one:
a.
None of these
b.
Method
c.
Object Oriented
d.
Class
e.
Encapsulation
Clear my choice

Question 7
Answer saved
Marked out of 1.00

Flag question

Question text
What do you call a variable that belong to the whole class?
Select one:
a.
Class Variable
b.
Object Variable
c.
Class Method
d.
None of these
e.
Static Variable
Clear my choice

Question 8
Answer saved
Marked out of 1.00

Flag question

Question text
It is the method of hiding certain elements of the implementation of a certain class?
Select one:
a.
None of these
b.
Class
c.
Object
d.
Object Oriented
e.
Encapsulation
Clear my choice

Question 9
Answer saved
Marked out of 1.00

Flag question

Question text
What is the result if we execute this: “a” instanceof String; ?
Select one:
a.
“a”
b.
false
c.
The code is not valid
d.
None of these
e.
true
Clear my choice

Question 10
Answer saved
Marked out of 1.00

Flag question

Question text
What will be the value of x if we execute this: String s = "25"; int x =
Integer.parseInt(s); ?
Select one:
a.
The code is not valid.

b.
None of these

c.
int 25

d.
String 25

e.
0

UGRD-ITE6104 Computer Programming 2


1. Home
2. My courses
3. UGRD-ITE6104-2023T
4. Week 13: Short Quiz
5. Final Quiz 2

Question 1
Answer saved
Marked out of 1.00

Flag question

Question text
It is the ability of an object to have many forms?
Select one:
a.
Inheritance
b.
Polymorphism
c.
Abstraction
d.
Interface
e.
None of these
Clear my choice

Question 2
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following is the correct way to call the constructor of the parent class?
Select one:
a.
this()
b.
super.call()
c.
this.call()
d.
super()
Clear my choice

Question 3
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following method is allowed to be overriden?
Select one:
a.
public static void setName(){}

b.
public no_override void setName(){}

c.
public final void setName(){}

d.
public void setName(){}

e.
None of these

Clear my choice

Question 4
Answer saved
Marked out of 1.00

Flag question
Question text
Which of the following is the correct way to use an interface?
Select one:
a.
public class Person use [InterfaceName] {}

b.
None of these

c.
public class Person implements [InterfaceName] {}

d.
public class Person apply [InterfaceName] {}

e.
public class Person extends [InterfaceName] {}

Clear my choice

Question 5
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following class declaration is not allowed to be inherited?
Select one:
a.
public class Person {}

b.
class Person{}

c.
public abstract class Person {}

d.
public final class Person {}

e.
None of these
Clear my choice

Question 6
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following is the correct way to define an interface?
Select one:
a.
public interface [InterfaceName] {}

b.
public class interface [InterfaceName] {}

c.
public [InterfaceName] {}

d.
interface: [InterfaceName]

Clear my choice

Question 7
Answer saved
Marked out of 1.00

Flag question

Question text
What do you call a class that inherits a class?
Select one:
a.
Parent class
b.
None of these
c.
Superclass
d.
Subclass
e.
Class
Clear my choice

Question 8
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following is true about Interface?
Select one:
a.
It defines a standard and public way of specifying the behavior of classes
b.
It is a special kind of block containing method signatures only
c.
All of these
d.
It is use to model multiple inheritance which allows a class to have more than one
superclass.
e.
It defines the signatures of a set of methods without the body
Clear my choice

Question 9
Answer saved
Marked out of 1.00

Flag question

Question text
What keyword is used to perform class inheritance?
Select one:
a.
None of these
b.
implements
c.
derives
d.
extends
e.
inherits
Clear my choice

Question 10
Answer saved
Marked out of 1.00

Flag question

Question text
Which of the following class declaration is not allowed to be instantiated?
Select one:
a.
public class Person {}

b.
None of these

c.
public final class Person {}

d.
public abstract class Person {}

e.
class Person{}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy