Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
75 Cards in this Set
- Front
- Back
To include swing and awt components in your program use the following import statements:
|
import javax.swing.*;
import java.awt.*; |
|
These types of components are coupled with their underlying peers.
|
Heavyweight
|
|
When this the argument pass to the jframe class setdefaultcloseoperation() method, the application is hidden, but not closed.
|
JFrame.Hide_ON_CLOSE
|
|
This is a basic window that has a border around it, a title bar, and a set of buttons for minimizing, maximizing, and closing the window.
|
Frame
|
|
Which of the following statements creates a class that derived from the jframe class?
|
public class DerivedClass; extends JFrame { }
|
|
What does the following statement do addbutton.addactionlistener(new actionlistener());
|
Creates an AddButtonListener object and regesters the AddButtonListener object
|
|
Event listeners must
|
Implement an interface
|
|
If button1 is a jbutton object which of the following statements will make its background blue?
|
button1.setBackground(Color.BLUE);
|
|
This layout manager arranges components in five regions.
|
BorderLayout
|
|
One or more objects may be created from a(n)
|
Class
|
|
A UML diagram does not contain
|
Objects names
|
|
Class objects normally have__________that perform useful operations useful on their data, but primitive variables do not.
|
Methods
|
|
In the cookie cutter method; Think of the_________as a cookie cutter and__________as the cookies.
|
Class; objects
|
|
A constructor
|
Has the same name as the class
|
|
You should not define a class field that is dependent upon the values of other class fields
|
In order to avoid having stale data
|
|
Data hiding which means that critical data stored inside the object is protected from code outside the object is accomplished in java by
|
Using the private access specifier on the class fields
|
|
For the following code, which statement is not true?
public class sphere ( private double radius; public double x; private double y; private double z; ) |
z is available to code that is written outside the sphere class
|
|
Methods that operate on an object's fields are called
|
Instance methods
|
|
The scope of a private instance field is
|
The instance methods of the same class
|
|
To compile a program named First, use the following command.
|
javac First.java
|
|
A Java program must have atleast one.
|
Class Definition
|
|
All Java lines of code end with semicolons.
|
False
|
|
This is normally considered the standard output and standard input devices and usually refer to the monitor and keyboard.
|
Console
|
|
What will be the values of x and y as a result of the following code?
int x= 25, y = 8; x+= y++; |
x = 33, y = 9
|
|
If a loop does not contain within itself a way to terminate, it is called:
|
An infinite loop
|
|
This type of loop will always be executed atleast once.
|
Post-test loop
|
|
What will be the value of x after the following code is executed?
int x = 10; while (x <100) { x + = 10; } |
100
|
|
What will be the value of x after the following code is executed
int x = 10, y = 20; while (y < 100) { x + = y; } |
This is an infinte loop
|
|
In the following code, what values could be read into number to terminate the while loop?
scanner keyboard = new scanner(system.in); system.out.print("enter a number: "); int number = keyboard.nextint(); while(number <100 && number >500) { system.out.print("enter another number: "); number= keyboard.nextint(); } |
The boolean condition can never be true
|
|
The do-while loop is a pre-test loop
|
False
|
|
What will be the value of x after the following code is executed?
int x = 10; do { x *=20; } |
This is an infinte loop
|
|
To complie a program named first, use the following command
|
javac First.java
javac First |
|
A java program must have atleast one
|
Class definition
|
|
All java lines of code end with semicolons;
|
False
|
|
This normally considered the standard output and standard input devices, and usually refer to the monitor and keyboard:
|
Console
|
|
If the following java statements are executed, what will be displayed?
system.out.println("The top three winners are \n"); system.out.print("Jody, the Giant\n"); system.out.print("Buffy, the Barbarian"); system.out.println("Adelle, the Alligator"); |
The top three winners are
Jody, the Giant Buffy, the BarbarianAdelle, the Alligator |
|
This is a value that is written into the code of a program
|
Literal
|
|
Which of the following is not a primitivate data type?
|
String
|
|
The boolean data type may contain values in the following range of values
|
True or False
|
|
What is the result of the following expression?
|
5
|
|
What is the result of the following statement?
|
7
|
|
Another term for an object of class is a(n)
|
Instance
|
|
A class specifies the ___ and __ that a particular type of object has
|
Fields; Method
|
|
The following code, which statement is not true?
public class circle { private double radius; public double x; private double y; } |
y is available to code that is written outside the circle class
|
|
After the header, the body of the method appears inside a set of
|
Braces, { }
|
|
in UML diagrams, this symbol indicates that a member is private
|
-
|
|
In UML digrams, this symbol indicates that a member is public
|
+
|
|
This refers to the combining of data and code into a single object
|
Encapsulation
|
|
In your textbook the general layout of a UML digram is a box that is divided into three sections. the top section has the ___; the middle section holds____; the bottom section holds____.
|
Class name; fields; methods
|
|
In UML diagram to indicate the data type of a variable enter
|
The variable name followed by a colon and the data type
|
|
It is common practice in object- oriented programming to make all of a class's
|
Fields private
|
|
Which of the statement are true about the following code?
final int ARRAY_ SIZE = 10; long[] array1 = new long [ARRAY_SIZE]; |
All of above
|
|
What will be the value of x[8] after the following code has been executed?
final int SUB = 12; int[] x = new int[SUB]; int y = 20; for (int i = 0, i <SUB; i++) { x[i] = y y+= 5; } |
60
|
|
3) what will be the result of executing the following code?
int[]x = {0,1,2,3,4,5}; |
An array of 6 values ranging from 0-5 and referenced by the variable x will be created
|
|
If final int SIZE = 15 and int [] x = new int[SIZE], what would be the range of subscript values that could be used with x[]?
|
0-14
|
|
What would be the results after the following code was executed?
int [] x = {23,55,83,19}; int [] y = {36,78,12,24}; x = y; y = x; |
x[] = {36, 78, 12, 24} and y[] = {36, 78, 12, 24}
|
|
What will be the value of x[1] after the following code is executed?
int[] x = {22,33,44}; arrayProcess(x[1]); ... public static void arrayPRocess(int a) { a= a + 5; } |
33
|
|
When an individual element of an array is passed to a method
|
The method does not have direct access to the original array
|
|
What would the result of the following code?
final int SIZE = 25; int[] array1 = new int[SIZE]; ...// code that will put values in array1 int value = 0; for (int a = 0, a <= array1.length;a++) { value += array1[a]; } |
This would cause the program to crash
|
|
What would be the result of the following code?
final int SIZE = 25; int[] array1 = new int[SIZE]; ...// code that will put values in array1 int value = 0; for (int a = 0, a <= array1.length;a++) { value += array1[a]; } |
This would cause the program to crash
|
|
What will be returned from the following method?
public static float[] getValue(int x) {/*method code*/} |
A reference to an array of float value
|
|
how many time will the following do-while loop be executed?
int x = 11; do { x +=20; } while (x>100); |
1
|
|
A loop that repeats a specific number of times is known as a(n)___
|
Counter-controlled loop
|
|
Another term for program is
|
Software
|
|
The major components of a typical computer system consist of
|
All of the above
|
|
A byte is a collection of
|
Eight bits
|
|
An operating system can be categorized according to
|
Both of the above
|
|
This is a special language used to write computer programs
|
Programming language
|
|
Application Software refers to programs that make the computer useful to the user.
|
True
|
|
Colons are used to indicate the end of a Java statement.
|
False
|
|
A procedure is a set of programming language statements that, together, perform a specific task.
|
True
|
|
Compiled byte code is also called source code.
|
False
|
|
Java source files end with the .class extension
|
False
|
|
JFC stands for
|
Java Foundation Classes
|
|
In a UML diagram to indicate the data type of a variable enter
|
The variable name followed by a colon and the data type
|