CSE 205 FINAL terms (Answered) 205
Questions and Correct Answers, 100%
Correct. 2024/2025.
In java, when you divide an int by another int, the result will be an
int
In java, functions are called
methods
The Java statement counter++ will
add 1 to the variable count
To help us collect information from the user through the keyboard in Java, we use a
Scanner
Every Java program consists of at least one
class definition
Which of the following are characteristics of the python programming language
compiled
interpreted
A name defined in an outer scope is also available in all blocks nested inside that scope
True
Operation are things an object
does
An object's attributes are implemented as
variables
In Java class members are declared with the keyword
static
A default constructor takes _____ arguments
0
Java boolean literal values are expressed in all lowercase
True
The java expression like the one below will evaluate to ________.
new Bunny("Flopsy", 8)
,an object reference
A reference type variable stores a _____________
reference
If a reference type variable does not store a reference to an object, then it stores __________.
a null reference
All of the Java primitive types are _______.
value types
The two kinds of types in the Java programming language are ___________.
value and reference types
The differences between value types and reference types applies to parameters
True
Which of the following would declare an array of integers in Java?
int[] my_array;
We cannot delete individual elements from an array in Java
True
We can use a variable as an index expression to access an array element in Java
True
Which of the following would declare and instantiate an array of 5 integers in Java?
int[] my_array = new int[5];
In java, a two dimensional array in Java is really an "array of arrays."
True
In Java, arrays are reference types
True
Which methods can be used to replace an element in an ArrayList?
set
Which method can be called to remove all elements from an ArrayList at once?
clear
Which method can be used to remove an element from an ArrayList?
remove
Java ArrayLists are like re-sizable arrays
True
, Which method can be used to insert an element into an ArrayList?
add
Only an enhanced for loop can be used to iterate over an ArrayList
False
Which object oriented element is used to define "is a" relationships?
Inheritance
Which object oriented element is used to define "has a" relationship?
Answered: Data Hiding
Which object oriented element is best defined as "an object should have complete authority over its
responsibilities"?
Answered: Inheritance, Encapsulation
We can more easily debug a program when the responsibilities are well encapsulated
True
An advantage of composition is the fact that we can sometimes reuse classes that we have already
written, instead of having to design and write new classes.
True
Data hiding can allow us to separate the information from its representation.
True
Java uses the same operator for exponentiation as Python
False
Which of the following are characteristics of the Java programming language?
none of these
Java uses the keyword ________ to return a value from a method
return
Method overloading distinguishes between methods based on
data types of arguments and number of arguments
The purpose of a constructor is to __________
initialize an object to a valid state
An object is an instance of a class
True
Which of the following are good analogies for classes an objects?
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
√ Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper ACADEMICAIDSTORE. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor $12.99. Je zit daarna nergens aan vast.