CS 0007 Final
true or false
A Boolean expression is one that is either
true
A class's satic methods do not operate on the fields that belong to any instance of that class
Ram usually
A volatile type of memeory, used only for temporary storage
Software
Another term for program is:
(str1.equalsIgnoresCase(str2) and (str1.compareToIgnoreCase(str2)
to do a case insensitive compare which of the following could test the equality of two strings
true
two general categories of methods are void methods and value returning methods
true
when an array of objects is declared, but not initialized, the array values are set to null
true
when an object is passed as argument, it is actually a reference to the object that is passed
true
when an object reference is passed to a method, the method may change the value in the object
false
when the break statement is encountered in the loop, all the statems in the body of the loop that appear after it are ignored and the loop prepares for the next interatin
fields private
it is common practice in object oriented programming to make all of a class's
string
java allows you to create objects of this class in the same way you would create primitive variables
true
java does not limited the number of dimensions that array may have
false
java is a case-insensitive language
number(r).length
length of element r
explicit import
look at the following statement import java.util.Scanner;
true
object can store data
true
objects in an array are accessed with subscripts, just like any other data type in an array
true
once an array is created it cannot be changed
false
only constants and varaibles may be passed as arguments as methods
true
programming sytle inludes techniquies for consistently putting spaces and indentations in a program
Application software
programs that make the computer useful to the end user
false
you can declare and enumerated date type inside of a method
true
you must have a retun statement in a value returning method
false, searching algorithm
a sorting algrothim is used to locate a
true
a variable's scope is the part of the program that has access to the variable
true
access specific indicates how the calss may be accessed
true
an instance of a class does not have to exist in order for value to be stored in a classes static fields
true
an object can store data
true
and enumerated data type is actually a special type of class
NOTE
GUI-almost everything is an object
str(0).toUpperCase();
Make something uppercase
false →post-test loop
the do-while loop is a pre-test loop
true
the expression in the return statement can be an expression that has a value
relational operators
The type of operator determeine whether a relationship exists
object names Contains: Classes, Fields, Methods
UML diagram will not contain
str(0)
for the following code, what would be the value of str(2)
a constructor
has the same name as the class
2
how many radio buttons at the same time the are mutually exclusive
false
if a [] and b [] are two integer arrays, the expression a ==b, compares the array contents
true
if the compiler encounters a statement that uses a variable before the variable is is declared, an error will result
true
if you write a toString method to display the contents of an object, object1, for a class 1 same thing? system.out.println(objectt1) system.out.println (object.toString())
false
in java the variable total is the same as the variable named Total
false
in the method header the static method modifier means the method is available to code out side the class
NOTE
instance and static should not be in the same sentence together
true
instance methods do not have the Keyword static in their headers
static
instance methods do not have this key word in their headers
multiple alternative decision structure
the switch statement is a
false
the this keyword is the name of a reference variable that is available to all static mehods
true
the while loop has too important parts, Boolean expression tested for true false, and block of statements that is repeated as long as expression is true
+add(object2: stock) ;
this is a public method named add that returns a stock object
true
if a class has a method named finalize, it is called automatically just before an instance o the class is destroyed by the garbage collector
true
when you open a file with the PrintWriter class, the calss can potentially throw an IOException
NOTE
if the variable is private, it is not available to code outside of the class accessor method gets a value from a class's field but does not change it
all of these whole number, monetary value, string, reference to object
in java it is possible to write a method that will return
false
in the method header, the method moidifer public mens that the method belongs to the class not a specific object
class name, attributes or fields, methods
in your textbook the general layout of a UML diagram
false
instance methods should be declared static
wildcard import
look at this statement, import java.util*; this is called what
syntax
rules that must be followed when writing a program supposed you are at an operation system command line and you are going to use a the following command to compile javac Myclass.java. Make sure you are in the same folder as Myclass.java
true
some of the common GUI components are buttons, lables, text fields
state
an objects' ___ is simply the data storied in the object's field at any given moment
instance
another term for an object of a class is an
instance
another term for object of class is an
true
any items typed on command line are passed into the main method
true
any method that calls a method with a throws clause in its header must either handle the potential exception nor have the same throws clause
while (inputFile.hasNext ())
assume that inputFile references a Scanner
radio.doClick();
assume that radio references a JRadioButton object
if(checkbox.IsSelected
assume that the variable check box
the account objects toString method will be implicitly called
assume the class BankAccount has been created, What is true about print line statement
false
assuming that pay has been declared a double, the following statement is vailid pay=2,583.44
highly portable
because java is the same on all computers, compiled java programs are:
true (everyting has a toString method whether you declare it or not)
enum constants have a toString method
ordinal
enumerated types have this method that returns the position of an enum constant in the declaration list
implement an interface
event listeners must
false
if a class method named finalize, it is called automatically just before a data member that has been identified as final, of the class is destroyed by the garbage collector
0 thorough 14
if array size 15
write a copy method that will make a field by field copy of object1 data member into object 2 data members
if object 1 and object 2 are objects of the same class, to make object 2 a copy of object 1
true
if you write a toString method for a class, Java will automatically call the method anytime you concatenate an object of the class with a string
frame
in GUI technology, a container displayed as a window
variable name, followed by colon then data type
in UML indicate the data type of variable is indicated how:
- minus sign
in UML, diagrams this symbol indicates that member is private
true
methods are commonly used to break a problem into smaller manageable pieces
true
named constants are initialized with a value and that value cannot be changed during the execution of the program
true
no statement outside of the method in which a parameter variable is declared can assess the parameter by its name
true
when the continue statement is encountered in a loop, al the
true
a single copy of a class's static field is shared by all instances of the class
false
a GUI program automatically stops executing when main is done
description of an object
a class is not an object but a
both the things the class is responsible for doing and knowing
a class's responsibilities
all of these initialize a control variable test the control variable by comparing it to a maximum/ minimum updates the control vriable during each iteration for( int i =0; i<letterGuessed.size(); i++)
a for loop normally performs which of these steps
false
a method tht gets a value from a class's field but does not change it is known as a mutator method
2-D array where the subarrays/row are of different lengths
a ragged array is a
false
both character literals and string literals can be assigned to a char variable
true
both instance fields and instance methods of an object are associated with a specific instance of a class and cannot be used until and instance of a class is created
0
by default, java initialized array elemets to what value
read an interpreted by JVM
byte code instructions are:
true
check boxes may be grouped into a ButtonGroup, like the radio buttons are
false
class names and keywords are examples of variables
true
an array list automatically expands int size to accommodate the items stored in it
braces {}
after the heder, the body of the methd appears inside a sate of
false
all java statements end with semicolons
Major components of a typical computer system
all of these(CPU, input/output, secondary storage, main memeory
false
all operation systems offer the same set of GUI Components
false
an array can hold multiple values of several different data types
method
class objects normally have ___that perform useful operations on their date, but primitive variables do not
CRC
class responsibility and collaborations
True
constants, variables, and the values of expressions may be passed as arguments to a method
class (cookie cutter) objects (cookies)
cookie cutter metaphor think of the ___ as the cookie cutter and the ___ as the cookies
using the private access specifier on the class fields
data hiding, which means that critical data stored inside the object is protected from code outside the object , is accomplished in Java by
true
declaring an array reference variable does not create an array
the purpose of validating the results of a program
determine whether the program solves the original problem
length
each array in java has a public field named
machine language
each different type of CPU has its own
an iteration
each repetition of the loop is known as
static
static methods can only operate on ___ fields
true
the ActionEvent argument that is passed into the action listeners action performed method