Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COSC Exam 2 with all Correct & 100% Verified Answers |Latest Version |Already Graded A+

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
20-06-2026
Written in
2025/2026

COSC Exam 2 with all Correct & 100% Verified Answers |Latest Version |Already Graded A+

Institution
Cosc
Course
Cosc

Content preview

COSC Exam 2 with all Correct & 100% Verified Answers |
Latest Version |Already Graded A+

Procedural programming ✔Correct Answer-focus is on the process. Procedures/functions are
written to process data

Object-oriented programming ✔Correct Answer-focuses on nouns, creating a new data type
within the program that has attributes and verbs

Class ✔Correct Answer-a template to build a specific type of object. Like a blueprint

Object ✔Correct Answer-a specific instance of a class that can store data and perform specific
actions

Attributes (or Fields) ✔Correct Answer-data about a class. Almost always private

Methods (or Behaviors) ✔Correct Answer-actions a class can perform. Usually public, but we
can have private helper methods

Public ✔Correct Answer-when the public access specifier is applied to a class member, the
member can be accessed by code inside the class or outsie

Private ✔Correct Answer-when the private access specifier is applied to a class member, the
member cannot be accessed by code outside the class. The member can be accessed only by
methods that are members of the same class

Data Hiding ✔Correct Answer-an object hides its internal, private fields from code that is
outside the class that the object is an instance of

Importance of Data Hiding ✔Correct Answer-classes are typically used as components in large
software systems, involving a team of programmers. Helps enforce the integrity of an object's
internal data

Accessors (or get methods) ✔Correct Answer-allow you to retrieve the values inside the
attributes

Mutators (or set methods) ✔Correct Answer-allow you to modify the values inside the
attributes

Stale Data ✔Correct Answer-occurs when we store the result of a calculation. Impractical.
Avoid by calculating the value of that data within a method rather than store it in a variable

, Constructor ✔Correct Answer-automatically called by Java when the keyword new is executed

set up methods that tell Java what values to put into the object at the time it is created

has the same name as the class (required)

no return type

No-arg constructor ✔Correct Answer-constructor that takes no arguments

Default Constructor ✔Correct Answer-if no constructor is provided, Java will create a default
constructor for you that sets all primitive values to 0 or false, and all objects to null.

Method Signature ✔Correct Answer-created through the method name and the data types of
the parameter list

Binding ✔Correct Answer-how the compiler knows which method to call

Shadowing ✔Correct Answer-creating a local variable the same name as an attribute in the
class

the local variable hides the attribute

uses the "this" reference

"this" reference ✔Correct Answer-"this" can be used to overcome shadowing and allow a
parameter to have the same name as an instance field

Equals method ✔Correct Answer-a method Java expects every class to have

returns a boolean and takes a parameter of the same type as the class in which it resides

toString method ✔Correct Answer-a method Java expects every class to contain

returns a String representation of the object. Takes no paramters

UML ✔Correct Answer-Unified Modeling Language

graphical language to represent object oriented systems

UML Class Diagram ✔Correct Answer-Rectangle with three defined areas:
Top area: Class name
Middle area: Attributes/fields
Bottom area: Methods

Written for

Institution
Cosc
Course
Cosc

Document information

Uploaded on
June 20, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Stuvia2026 Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
24
Member since
1 year
Number of followers
1
Documents
5748
Last sold
2 weeks ago
\"Your trusted Hub for Academic Excellence\"

Stuvia 2024 is your trusted destination for top-tier study materials, including high-quality exams, assignments, and verified answer keys. Our content is crafted for excellence thorough, up-to-date, and tailored to help students succeed in their academic journey. Whether you\'re preparing for a final exam or need support with coursework, every document in our store is designed to provide clarity, accuracy, and confidence. At Stuvia 2024, academic success starts with the right resources.

Read more Read less
2.3

3 reviews

5
0
4
0
3
2
2
0
1
1

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions