• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/57

Click to flip

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;

57 Cards in this Set

  • Front
  • Back

What is a dependency line in Astah*?

It shows what a driver class creates and uses to run. Example: Driver class --> utility class

In Astah, what is the heading under which you can label dependency lines?

Stereotype

What is the Astah extension?

.asta

What does Instantiation mean?

A method of an object may instantiate and use an object of another class to do a specific task but the object being used is not a fundamental part of the object using it.

What is typical of instantiation regarding objects of classes?

Typically, a method of one class instantiates and uses and object of another class but the object of the latter is not a part of the former.

What is instantiation?

Basically...creating an object of a class (an instance of a class)

What is an aggregation?

A type of "Has-a" relationship in which one object "Has-a" object of another class as an attribute, but that object is not essential to the existence of the other, and it is not instantiated by the constructor of the other.

What are the 8 primitive Java value types?

int, float, double, char, boolean, byte, short, long

What is the variable of a primitive type? (according to Bailes?)

A container for one value of its appropriate type.

What happens when you assign another value to a variable (at least w/primitive types)?

The second value replaces the first value (if there is an initial value).

What is a reference type?

A variable declared as a reference to an object of some class (either built in or user-defined).

What is the value of a reference variable before it is given a proper object?

Null

What is a shallow copy as apposed to a standard copy.

A shallow copy copies a reference, rather the original source of the value.

How many references can a reference type refer to?

Only one

What are ordinary attributes and methods of a class called? Why?

Instance items, because every object of the class has its own copy.

What is a static item?

An item that is shared by every instance (or object) of the class.

Does the driver class have both instances and static items?

No, it only has static items including the main method and only one driver.

Main method can only reference instance/static objects (pick one!)

Static

What is an enumerated data type?

A data type that has a small number of specific values.

What is enum similar to as far as definition goes?

Class

Does enum normally have a constructor?

No

Should you include Enumerated types within other .java files?

No, they should be in their own unique .java file

What is any type of use of enumerated data?

A reference

How is the size of enumerations determined?

By the initial order they are in when created.

What are all the methods of the Enumeration Type?

toString


ordinal


equals


compareTo


values


valueOf

What does Enumeration's toString do?

returns name of the constantq

What does Enumeration's ordinal do?

returns the zero-based position of the constant in the enum.

What does Enumeration's equals do?

accepts an object as an argument and returns true if the argument is equal to the calling enum constant.

What does Enumeration's compareTo do?

accepts an object as an argument and returns a negative integer if the calling constant's ordinal is less than the argument's ordinal, a positive integer if the calling constant's ordinal is greater than the argument's ordinal, and zero if the calling constant's ordinal equals the argument's ordinal.

What does Enumeration's values do?

Returns an array of all the values the enumerated type has.

What does Enumeration's valueOf do?

static method that returns the enumerated value corresponding to the string used as a parameter: an exception will be thrown if the string parameter does not exactly match one of the enumerated type's values including the correct case.

How do you convert an Enum to a String?

Use the toString method of the enum type.


EX: PhotoType.JPG.toString()

How do you convert a String to Enum?

use the valueOf method of the enum type

Translate this: for (face F : face.values())


System.out.println(F);

For every face that I will call F, output the value of face

What is the class in Java API for creating random numbers?

Random

How do you import the Random class into your file?

import java.util.Random;


Random randomNumber = new Random();

Name the methods (learned so far) of the Random class

nextDouble() - returns the next random number as a double. The number will be within the range of o.o and 1.0


nextFloat() - Returns the next random number as a float, will be within range of 0.0 and 1.0


nextInt() - returns the next random number as an int within the range of -2,147,483,648 to +2,147,483,648.


nextInt(int n) - This method accepts and integer argument, n, It returns a random number as an int. The number will be within the range of 0 to n.

How are the random numbers distributed?

Uniformly distributed - all values in the range are equally likely to occur.

When using nextInt(n) in the Random class, is n included within the range?

No, it is 0 - (n - 1) that are possible values.

How do you create a "range of doubles"?

double rand = r.nextDouble() * (d2 - d1) + d1

What is a dialog box?

A small graphical window that displays a message to the user or requests input.

What are the three simple dialog boxes that can be displayed using JOptionPane?

Message Dialog


Input Dialog


Confirm Dialog

What are the two arguments for "Message Dialog"? (when using the 2-argument constructor)

(messageLocation, messageString)

What are the arguments when using the 4-argument MessageDialog constructor?

(messageLocation, message, title, icon)

What are the icons that can be displayed in JOptionPane?

JOptionPane.ERROR_MESSAGE


JOptionPane.INFORMATION_MESSAGE


JOptionPane.WARNING_MESSAGE


JOptionPane.QUESTION_MESSAGE


JOptionPane.PLAIN_MESSAGE

What does a modal box do?

it suspends execution of any other instructions in the program until the dialog box is closed.

What are the features of an input dialog?

Text field


OK button


Cancel button

What are two overloaded versions of the static showInputDialog method

showInputDialog(Object message)


showInputDialog(Component parent,


Object message


String title,


int messageType)

What are the default values for the input dialog?

has the string "Input" in its title bar and displays a question icon.

How would you handle when a particular value is entered very frequently with Input Dialog?

The value can be used as a default value the user can either accept or replace: JOptionPane.showInputDialog(prompt, defaultValue)

What is the only type of data the Input Dialog inputs?

String

How do wrapper classes relate to primitive data types?

They are used to Parse Strings to other types. The name differs normally only in that the first letter is capitalized...ex: byte - Byte | int - Integer

How would you parse a String "1" to a byte?

byte bVar = Byte.parseByte("1")

What is the default Confirm Box buttons?

Yes, No, and cancel

&


"Select an Option" in the title bar


What are two overloaded versions of the showConfirmDialog?

int showConfirmDialog(Component parent, Object message)




int showConfirmDialog(Component parent, Object message, String title, int optionType)

What are the three basic constants that the showConfirmDialog uses to compare the button results?

JOptionPane.YES_OPTION


JOptionPane.NO_OPTION


JOptionPane.CANCEL_OPTION

What, in the JOptionPane, offers more flexibility in buttons?

Option Dialog