• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 16 pages
Exam (elaborations)

CS 3330 Final || with Complete Solutions.

Document preview thumbnail
Preview 3 out of 16 pages

CS 3330 Final || with Complete Solutions.

Content preview

CS 3330 Final || with Complete Solutions.
object correct answers software bundle of 2 related characteristics: state and behavior

- an *instance* of a class
- has a state in which all of its properties have values

fields correct answers stores *states*

methods correct answers exposes state's *behavior*

serve as primary mechanism for object-to-object communication

modularity correct answers code written and maintained independently

information-hiding correct answers details of internal implementation remain hidden from
outside world

code re-use correct answers if object already exists, you can use that object in your program

- allows specialists to implement/test/debug complex, task-specific objects to run in your own
code

Pluggability and debugging ease correct answers if object is problematic, can remove from your
app and plug in a different object as replacement

class correct answers blueprint from which individual objects are created = a template for object

- defines object properties including a valid range of values and default value
- describes object behavior

instance correct answers bicycle is an instance of the class of objects known as bicycles

EX: class Bicycle { ... }
class BicycleDemo {
main() {
// bicycle objects
Bicycle bike1 = new Bicycle();
// invoke methods
bike1.speedUp(10);
}
}

access level modifiers correct answers determine whether other classes can use a particular field
or invoke a method

,top level access modifiers correct answers 1. *public*
2. *package-private* (no explicit modifier)

member level access modifiers correct answers 1. *public*
2. *private*
3. *protected*
4. *package-private* (no explicit modifier)

public access modifier correct answers class is visible to all classes everywhere

- class
- package
- subclass
- world

protected access modifier correct answers member can only be accessed within its own package

- class
- package
- subclass

no modifier (package-private) access modifier correct answers visible only within its own
package

- class
- package

private access modifier correct answers member can only be accessed within its OWN class and
CANNOT be overridden

- class

enum types correct answers special data type that enables for a variable to be a set of predefined
constants
- in all uppercase letters

EX: MAX_WIDTH, NORTH

this keyword correct answers reference to the current object (object whose method or constructor
is being called)
- used to resolve conflicts between method parameters and instance fields/methods of the
invoked class commonly used in Java

EX:
public Point(int x, int y) {
this.x = x;

, this.y = y;
}

steps to creating an object correct answers 1. *declaration* of a new object: type and variable
name
2. *initialization*: set the values
3. *installation*: new object name and returns new address to memory location

A method in a class declared as ______ can only access ______ class members.

public, public
static, static
public, protected
static, instance
instance, static
private, public
private, private correct answers static, static

- *static method* can only access static variables

Which of the following statements is correct?

All of the statements either produce compile errors or runtime errors
Integer.parseInt(100);
Integer.parseInt(100, 16);
Integer.parseInt("12", 2);
Integer.parseInt("345", 8);
All of the statements are correct correct answers Integer.parseInt("345", 8);

parseInt(String s, int radix) OR parseInt(String s)

Which of the following statements is true?

Overloading a method is to provide more than one method with the same name but with different
signatures to distinguish them.

To override a method, the method must be defined in the subclass using the same signature and
compatible return type as in its superclass.

If a method defined in a subclass is private that has the same method signature and return type as
in its superclass which is also private, the two methods are completely unrelated.

It is a compilation error if two methods differ only in return type in the same class.

None of the answers are true

Document information

Uploaded on
June 13, 2026
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.19

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

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.
SirAnton
3.7
(118)
Sold
810
Followers
438
Items
40067
Last sold
1 week ago



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