SlideShare a Scribd company logo
1 of 10
CS 192 test questions 1-44
1. Global variables are known to the entire class.
A) True
B) False
2.
A class diagram consists of a ____ divided into three sections.
A) square
B) rectangle
C) circle
D) triangle
3.
Programmers refer to hidden implementation details as existing
in a ____.
A) white box
B) white hole
C) black box
D) black hole
4.
____ is the process of creating a new, derived class from a base
class.
A) Accessibility
B) Encapsulation
C) Inheritance
D) Polymorphism
5.
An object is a category of things.
A) True
B) False
6.
An instance method or constructor may be overloaded by
providing the same name and ____ argument list.
A) a different
B) the same
C) a larger
D) a smaller
7.
A method’s ____ consists of the method’s statements.
A) body
B) space
C) space
D) group
8.
A constructor may require ____.
A) parameters
B) methods
C) objects
D) inheritance
9.
Everything is an object, and every object is a member of a ____.
A) class
B) method
C) case
D) process
10.
A method is a program module that contains a series of
statements that carry out a task.
A) True
B) False
11.
Simple non-array variables are usually passed to methods by
____.
A) value
B) reference
C) type
D) class
12.
The object-oriented techniques to manage errors such as
dividing a value by 0 comprise the group of methods known as
____.
A) exception handling
B) error handling
C) exception processing
D) error processing
13.
Class diagrams are a type of ____ diagram.
A) Unified Illustration Language
B) Unified Modeling Language
C) Object-Oriented Modeling Language
D) Unified Pseudocode Language
14.
Creating multiple methods with the same name, which will act
differently and appropriately when used with different types of
objects, is known as polymorphism.
A) True
B) False
15.
A (n) ____ is one instance of a class.
A) Method
B) object
C) instantiation
D) attribute
16.
Unreachable code statements are program statements that only
execute if there is an exception.
A) True
B) False
17.
A method can be used more than once within a program or in
other programs.
A) True
B) False
18.
Overloaded methods have the same name and parameter lists.
A) True
B) False
19.
You can write as many constructors for a class as you want, as
long as they all have different ____ lists.
A) object
B) data field
C) method
D) parameter
20.
Methods can be ____ correctly by providing different parameter
lists for methods with the same name.
A) updated
B) tested
C) overloaded
D) passed
21.
What is one item that must be included in a method’s header if
it can receive a parameter?
A) local parameter name
B) global parameter name
C) parameter’s client
D) return data structure
22.
A child class contains all the data fields and ____ of its parent.
A) parameters
B) classes
C) methods
D) procedures
23.
A catch block consists of four different elements: the keyword
catch, followed by parentheses that contain an exception type
and identifier, statements that take action to handle the error
condition, an endcatch statement, and a return statement.
A) True
B) False
24.
When a main() method needs to use another method, it calls, or
invokes it.
A) True
B) False
25.
____ variables and constants are those that are known to an
entire class.
A) Global
B) Local
C) Universal
D) Comprehensive
26.
What is the screen output of the following code segment?
Explain the reasoning behind your answer.
Answer:- Your Average is
You will do better next time!
27.
Libraries are collections of classes that serve related purposes.
A) True
B) False
28.
When a variable is declared within a method, it ceases to exist
when the method ends.
A) True
B) False
29.
What will be the output of the below program? List what will be
outputed to the screen and explain your answer.
Output:- The output is 10 20 30 40 50 60 70 80 90 100
Output index is a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8]
a[9]
30.
The call stack is where the computer stores the list of
exceptions.
A) True
B) False
31.
Write a method that will perform the a division operation
(divide by) on the numbers passed to it in two variables
(numerator, denominator) and outputs the results. Use a try-
catch pair to output an error message if the illegal operation of
divide by 0 occurs.
Answer:-
32.
Multiple inheritance is the capability to inherit more than one
method from a parent class.
A) True
B) False
33.
A(n) ____ statement indicates the end of the catch block in the
pseudocode.
A) finalcatch
B) finally
C) endcatch
D) stop
34.
A ____ reference is an automatically created variable that holds
the address of an object and passes it to an instance method
whenever the method is called.
A) key
B) public
C) that
D) this
35.
When illegal division by 0 takes place, an Exception object is
not created automatically by the object-oriented language
application.
A) True
B) False
36.
Design a class named CustomerRecord that holds a customer
number, name, and address. Include methods to set the values
for each data field and output the values for each data field.
Create the class diagram and write the code (not language
specific, ie. psuedocode) that defines the class.
37. When appropriate, specialized ____ classes provide an
elegant way for you to handle error situations.
A) Exception
B) Error
C) Constructor
D) Event
38. A ____ is one that sends an exception object out of a
method so it can be handled elsewhere.
A) catch statement
B) throw method
C) catch block
D) throw statement
39. The memory location known as the ____ is where the
computer stores the list of method locations to which the system
must return.
A) method stack
B) location stack
C) call stack
D) store location
40. When a data field is private, it is said to be ____ to any
class other than the one in which it is defined.
A) uninheritable
B) implicit
C) unreachable
D) inaccessible
41. Methods are sometimes called ____.
A) segment
B) modules
C) classes
D) routines
42. A ____ is a segment of code that can handle an exception
that might be thrown by the try block that precedes it.
A) catch method
B) throw block
C) catch block
D) throw statement
43. A parent class is the same thing as a base class.
A) True
B) False
44. The ability to use methods without knowing the details of
their contents is a feature of ____.
A) abstraction
B) encapsulation
C) inheritance
D) construction

More Related Content

Similar to CS192 test questions covering classes, objects, methods

GSP 125 Final Exam Guide
GSP 125 Final Exam GuideGSP 125 Final Exam Guide
GSP 125 Final Exam Guidecritter13
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxjosephineboon366
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1 UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1 Knowledge Center Computer
 
Which of the following is not one of the rules cited in class for making e ma...
Which of the following is not one of the rules cited in class for making e ma...Which of the following is not one of the rules cited in class for making e ma...
Which of the following is not one of the rules cited in class for making e ma...josbuttlewr116
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.comjonhson300
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.comjonhson282
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentspavan81088
 
one of the rules cited in class for making e-mail more effective Experience T...
one of the rules cited in class for making e-mail more effective Experience T...one of the rules cited in class for making e-mail more effective Experience T...
one of the rules cited in class for making e-mail more effective Experience T...pinck3125
 
Gsp 125 Education Organization -- snaptutorial.com
Gsp 125   Education Organization -- snaptutorial.comGsp 125   Education Organization -- snaptutorial.com
Gsp 125 Education Organization -- snaptutorial.comDavisMurphyB85
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917lakshmi r
 
Java method present by showrov ahamed
Java method present by showrov ahamedJava method present by showrov ahamed
Java method present by showrov ahamedMd Showrov Ahmed
 
GSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comGSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comdonaldzs162
 
GSP 125 Education Specialist / snaptutorial.com
  GSP 125 Education Specialist / snaptutorial.com  GSP 125 Education Specialist / snaptutorial.com
GSP 125 Education Specialist / snaptutorial.comstevesonz146
 
GSP 125 RANK Education for Service--gsp125rank.com
GSP 125 RANK  Education for Service--gsp125rank.comGSP 125 RANK  Education for Service--gsp125rank.com
GSP 125 RANK Education for Service--gsp125rank.comclaric25
 
GSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.comGSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.comsholingarjosh136
 

Similar to CS192 test questions covering classes, objects, methods (20)

Java execise
Java execiseJava execise
Java execise
 
Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ  Part - 3 Cpp programming Solved MCQ
Part - 3 Cpp programming Solved MCQ
 
GSP 125 Final Exam Guide
GSP 125 Final Exam GuideGSP 125 Final Exam Guide
GSP 125 Final Exam Guide
 
C Programming
C ProgrammingC Programming
C Programming
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docx
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1 UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
 
Which of the following is not one of the rules cited in class for making e ma...
Which of the following is not one of the rules cited in class for making e ma...Which of the following is not one of the rules cited in class for making e ma...
Which of the following is not one of the rules cited in class for making e ma...
 
GSP 125 Enhance teaching/tutorialrank.com
 GSP 125 Enhance teaching/tutorialrank.com GSP 125 Enhance teaching/tutorialrank.com
GSP 125 Enhance teaching/tutorialrank.com
 
GSP 125 Effective Communication/tutorialrank.com
 GSP 125 Effective Communication/tutorialrank.com GSP 125 Effective Communication/tutorialrank.com
GSP 125 Effective Communication/tutorialrank.com
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming students
 
one of the rules cited in class for making e-mail more effective Experience T...
one of the rules cited in class for making e-mail more effective Experience T...one of the rules cited in class for making e-mail more effective Experience T...
one of the rules cited in class for making e-mail more effective Experience T...
 
Gsp 125 Education Organization -- snaptutorial.com
Gsp 125   Education Organization -- snaptutorial.comGsp 125   Education Organization -- snaptutorial.com
Gsp 125 Education Organization -- snaptutorial.com
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
Java method present by showrov ahamed
Java method present by showrov ahamedJava method present by showrov ahamed
Java method present by showrov ahamed
 
GSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.comGSP 125 Exceptional Education - snaptutorial.com
GSP 125 Exceptional Education - snaptutorial.com
 
GSP 125 Education Specialist / snaptutorial.com
  GSP 125 Education Specialist / snaptutorial.com  GSP 125 Education Specialist / snaptutorial.com
GSP 125 Education Specialist / snaptutorial.com
 
GSP 125 RANK Education for Service--gsp125rank.com
GSP 125 RANK  Education for Service--gsp125rank.comGSP 125 RANK  Education for Service--gsp125rank.com
GSP 125 RANK Education for Service--gsp125rank.com
 
GSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.comGSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.com
 

More from faithxdunce63732

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxfaithxdunce63732
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxfaithxdunce63732
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxfaithxdunce63732
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxfaithxdunce63732
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxfaithxdunce63732
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxfaithxdunce63732
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxfaithxdunce63732
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxfaithxdunce63732
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxfaithxdunce63732
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxfaithxdunce63732
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxfaithxdunce63732
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxfaithxdunce63732
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxfaithxdunce63732
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxfaithxdunce63732
 

More from faithxdunce63732 (20)

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docx
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docx
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docx
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docx
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docx
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docx
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docx
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docx
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docx
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docx
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docx
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docx
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docx
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docx
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docx
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docx
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docx
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docx
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

CS192 test questions covering classes, objects, methods

  • 1. CS 192 test questions 1-44 1. Global variables are known to the entire class. A) True B) False 2. A class diagram consists of a ____ divided into three sections. A) square B) rectangle C) circle D) triangle 3. Programmers refer to hidden implementation details as existing in a ____. A) white box B) white hole C) black box D) black hole 4. ____ is the process of creating a new, derived class from a base class. A) Accessibility B) Encapsulation C) Inheritance D) Polymorphism
  • 2. 5. An object is a category of things. A) True B) False 6. An instance method or constructor may be overloaded by providing the same name and ____ argument list. A) a different B) the same C) a larger D) a smaller 7. A method’s ____ consists of the method’s statements. A) body B) space C) space D) group 8. A constructor may require ____. A) parameters B) methods C) objects D) inheritance 9. Everything is an object, and every object is a member of a ____. A) class
  • 3. B) method C) case D) process 10. A method is a program module that contains a series of statements that carry out a task. A) True B) False 11. Simple non-array variables are usually passed to methods by ____. A) value B) reference C) type D) class 12. The object-oriented techniques to manage errors such as dividing a value by 0 comprise the group of methods known as ____. A) exception handling B) error handling C) exception processing D) error processing 13. Class diagrams are a type of ____ diagram. A) Unified Illustration Language
  • 4. B) Unified Modeling Language C) Object-Oriented Modeling Language D) Unified Pseudocode Language 14. Creating multiple methods with the same name, which will act differently and appropriately when used with different types of objects, is known as polymorphism. A) True B) False 15. A (n) ____ is one instance of a class. A) Method B) object C) instantiation D) attribute 16. Unreachable code statements are program statements that only execute if there is an exception. A) True B) False 17. A method can be used more than once within a program or in other programs. A) True B) False 18. Overloaded methods have the same name and parameter lists.
  • 5. A) True B) False 19. You can write as many constructors for a class as you want, as long as they all have different ____ lists. A) object B) data field C) method D) parameter 20. Methods can be ____ correctly by providing different parameter lists for methods with the same name. A) updated B) tested C) overloaded D) passed 21. What is one item that must be included in a method’s header if it can receive a parameter? A) local parameter name B) global parameter name C) parameter’s client D) return data structure 22. A child class contains all the data fields and ____ of its parent. A) parameters
  • 6. B) classes C) methods D) procedures 23. A catch block consists of four different elements: the keyword catch, followed by parentheses that contain an exception type and identifier, statements that take action to handle the error condition, an endcatch statement, and a return statement. A) True B) False 24. When a main() method needs to use another method, it calls, or invokes it. A) True B) False 25. ____ variables and constants are those that are known to an entire class. A) Global B) Local C) Universal D) Comprehensive 26. What is the screen output of the following code segment? Explain the reasoning behind your answer. Answer:- Your Average is You will do better next time! 27.
  • 7. Libraries are collections of classes that serve related purposes. A) True B) False 28. When a variable is declared within a method, it ceases to exist when the method ends. A) True B) False 29. What will be the output of the below program? List what will be outputed to the screen and explain your answer. Output:- The output is 10 20 30 40 50 60 70 80 90 100 Output index is a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] 30. The call stack is where the computer stores the list of exceptions. A) True B) False 31. Write a method that will perform the a division operation (divide by) on the numbers passed to it in two variables (numerator, denominator) and outputs the results. Use a try- catch pair to output an error message if the illegal operation of divide by 0 occurs. Answer:- 32. Multiple inheritance is the capability to inherit more than one method from a parent class. A) True B) False 33.
  • 8. A(n) ____ statement indicates the end of the catch block in the pseudocode. A) finalcatch B) finally C) endcatch D) stop 34. A ____ reference is an automatically created variable that holds the address of an object and passes it to an instance method whenever the method is called. A) key B) public C) that D) this 35. When illegal division by 0 takes place, an Exception object is not created automatically by the object-oriented language application. A) True B) False 36. Design a class named CustomerRecord that holds a customer number, name, and address. Include methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code (not language specific, ie. psuedocode) that defines the class. 37. When appropriate, specialized ____ classes provide an elegant way for you to handle error situations. A) Exception
  • 9. B) Error C) Constructor D) Event 38. A ____ is one that sends an exception object out of a method so it can be handled elsewhere. A) catch statement B) throw method C) catch block D) throw statement 39. The memory location known as the ____ is where the computer stores the list of method locations to which the system must return. A) method stack B) location stack C) call stack D) store location 40. When a data field is private, it is said to be ____ to any class other than the one in which it is defined. A) uninheritable B) implicit C) unreachable D) inaccessible 41. Methods are sometimes called ____. A) segment
  • 10. B) modules C) classes D) routines 42. A ____ is a segment of code that can handle an exception that might be thrown by the try block that precedes it. A) catch method B) throw block C) catch block D) throw statement 43. A parent class is the same thing as a base class. A) True B) False 44. The ability to use methods without knowing the details of their contents is a feature of ____. A) abstraction B) encapsulation C) inheritance D) construction