Title: JavaChapter3

Q: keyword public is an example of a
A: access modifier

Q: This type specifies the type of data that the method returns after performing its task
A: return type

Q: "public void displayMessage()" is known as a
A: method header

Q: What is the symbol of a dot separator?
A: .

Q: A method that reads individual words
A: next

Q: Variables that are declared inside a class declaration but outside the bodies of the class's method declarations
A: Fields

Q: Public and private are keywords known as
A: access modifiers

Q: Any class that calls the object's method
A: Client of an object

Classes often provide public methods to allow clients to set (assign values to) or get (obtain values of) private instance variables.

Q: boolean, byte, char, short, int, long, float, and double are examples of
A: primitive reference types

Q: How do you make a guillemet
A: << and >>

Q: What is floating-point number is also known as?
A: precision

Q: access modifier
A: this is a keyword that declares who can access the method being used.

Q: return type
A: this specifies the type of data that the method returns to its caller after performing its task.

Q: new
A: this keyword creates a new objectof the class specified to the right of the keyword.

Q: constructor
A: The parenthasis in combination to the class name represent a call to this..

Q: dot separator
A: this is a call that causes the displaymessage method to perform its task.

Q: parameter
A: any additional information to the task being performed.

Q: default package
A: classes that are compiled in the same directory.

Q: fields
A: these are varriables that are declaired inside of a class declaration but outside the bodies of the class's method declarations

Q: local variables
A: these are declaired in the body of a particular method and can only be used in that method.

Q: data hiding
A: declairing instance variables with access modifier private

Q: In UML, each class is modeled in a class diagram as a rectangle with three [...]
A: compartments

Q: Keyword [...] creates a new object of the class specified to the right of the keyword
A: new

Q: A [...] is the parenthesis used in conjunction with the use of a class name
A: constructor

Q: A method is composed of one or more [...] that specify a type and identifier to help a method perform its task
A: parameters

Q: [...] are those that are declared within the body of a particular method
A: Local variables

Q: [...]s represent single-precision floating-point numbers aka up to seven significant figures
A: float

Q: [...] represent double-precision floating point numbers aka up to 15 significant numbers
A: Doubles

Q: The [...] method returns the double value entered by a user
A: nextDouble

Q: The JOptionPane comes from the java package [...].
A: javax.swing

Q: By default the compiler provides a [...] with no parameters that does not explicitily include a constructor
A: default constructor

Q: Acess modifier
A: Determines what can call the method (public or private)

Q: Return type
A: The type of data a method returns to the caller

Q: Void
A: A return type that indicates the method will perform a task, but not return anything.

Q: Method name convention
A: First letter is lowercase, every other word starts uppercase. nameExample.

Q: Static method
A: Can call the method without first creating an object of the class in which the method is declared.

Q: You can not call a [...] that belongs to another [...] until you creat an [...] of that class.
A: method; class; object

Q: Constructor
A: Used only at the time an object is created to initialize the object's data. Similar to a method.

Q: Parameters
A: Specifies type and name of variables

Q: Arguments
A: values for each method's parameters.

Q: Default package
A: classes compiled in the same directory on disk

Q: [...] are not required when one [...] in a package uses another in the [...].
A: Import declarations; class; same package

Q: Local variables
A: Variable declared in the body of a method. Only used in that method.

Q: Fields
A: Attributes represented as variables in a class declaration.

Q: Instance variable
A: Each object (instance) of the class has a seperate instance of the variable in memory

Q: Private
A: An access modifier that makes a method only accessible to methods of the calss in which it is declared.

Q: The default initial value for a string
A: null

Q: The default initial value for a number
A: 0 (zero)

Q: Client of an object
A: any class that calls the object's methods

Q: Set
A: assigns values to something

Q: Get
A: Obtains the values of something

Q: Primitive types
A: boolean, byte, char, short, int, long, float, double

Q: Reference types
A: all nonprimitive types; classes which specify types of objects.

Q: Primitive variable
A: stores exactly 1 value of its declared type at a time.

Q: Reference variable
A: Stores locations of objects in memory (ojects can contain many instances of variables).

Q: Floating-point number
A: Any number with a decial point

Q: Float
A: type of variable; a number up to 7 sig figs.

Q: Double
A: Type of variable; a number up to 15 sig figs.

Q: %f
A: format specifier used to output values of type float or double.

Q: %.2f
A: Outputs float or double value to two decimal places.

Q: Dialog boxes
A: Display output not in the command window.

Q: JOptionPane
A: Class for using dialog boxes

Q: GUI
A: Graphical User Interface

Q: Calling a static method
A: ClassName.methodName(arguments)

Q: Input dialog
A: Allows the user to enter data in a window.

Q: String.format method
A: works like System.out.printf, but in a dialog box, not command window.

Q: The name of the [...] [...] the same as the name of the [...].
A: class; MUST BE; .java file

Q: Indicates that nothing will be returned from the user.
A: Void

Q: Empty parentheses in a mehod definition indicate?
A: No more information is needed to perform the task.

Q: The keyword to create a variable in a specific class.
A: New

Q: These are used to initialize an object's data.
A: Constructors

Q: Any additional information that is needed to perform a program.
A: Parameters

Q: The number of [...] must be [...] the number of [...].
A: arguments; the same as; parameters

Q: Variables declared in the [...] of a particular method are called [...] and can [...] be used in that method.
A: body; local variables; only

Q: Attributes represented as variables in a class decleration.
A: Fields

Q: Indicates that a variable is only accessible in the class where the variable is declared.
A: Private

Q: Every [...] has a default [...].
A: field; initial value

Q: A primitive type of variable can store how many values at a time?
A: One at a time, but it can be replaced.

Q: Describe the important difference between constructors and methods.
A: Constructors cannot return values, methods can

Q: This class provides dialogue boxes
A: JOptionPane

Q: String formate() does what in a Java program?
A: It does the same thing as system.out.printf except in a dialogue box instead of in a command window.

Q: Method declerations are written in?
A: Camelcase with the first letter in lowercase

Q: nextLine will read a string until what is encountered?
A: a new line (\n) character

Q: next reads a string until what is encountered?
A: a white-space character

Q: What are the two items that must be specified with regards to a parameter?
A: must specify (1) a type and (2) a variable name

Q: The default value for a String field
A: Null

Q: Initializes an object of a class when the object is created
A: constructor

Q: In... public GradeBook(String name)
       {
            courseName = name;
        }
...what is does "courseName = name;" do?
A: initializes courseName

Q: What is this, in the most basic terminology?
public String getCourseName()
{
     return courseName;
}
A: method (to get the course name)

Q: "%f" is used when you have what kind of output value(s)?
A: float or double

Q: What does class "JOptionPane" provide?
A: dialog boxes that enable a program to display windows containing messages

Q: Within class "JOptionPane", what is "showMessageDialog()"?
A: method (displays a dialog box containing a specified message)

Q: access modifier
A: declares who has access to class (private, public)

Q: return type
A: specifies the type of data the method returns to its caller after performing its task

Q: return type void
A: indicates that this method will perform a task but will not give back any information

Q: A class that contains [...] begins the [...].
A: method main; execution of a Java application

Q: A [...] is special because you can call it without first creating an [...] in which the method is declared.
A: static method; object of the class

Q: Keyword [...] creates a new object of the class specified to the [...] of the keyword.
A: new; right

Q: constructor
A: similar to a method but is used only at the time an object is created to initialize the object's data

Q: instance variable
A: the field that represents an attribute of a class

Q: Variables or methods declared with access modifier [...] are accessible only to methods of the class in which they're declared.
A: private

Q: set method
A: assigns values to

Q: get method
A: obtains the values of

Q: An important difference between constructors and [...] is that constructors cannot return values, so they cannot specify a return type.
A: methods

Q: floating-point number
A: number with a decimal point

Q: variable of type double
A: represent double-precision floating-point numbers and provide 15 significant digits

Q: The format specifier [...] is used to output values of type [...].
A: %f; float or double

Q: Class [...] provides [...] that enable programs to display windows containing messages.
A: JOptionPane; prebuilt dialog boxes

Q: static method
A: such methods often define frequently used tasks

Q: The keyword public is an [...].
A: access modifier

Q: Return type
A: Aspect of a method that specifies the type of data the method returns to its caller after performing its specified task.

Q: void
A: Indicates the method will perform its task but not return any information.

Q: A static method
A: A method that can be called without first creating an object of the class in which the method is declared.

Q: new
A: Keyword that creates a new object of the class specified to the right of the keyword.

Q: Constructor
A: Used only at the time an object is created to initialize the object's data.

Q: Local variables
A: Variables declared in the body of a particular method that can only be used within that method.

Q: Fields
A: Attributes of an object that are manipulated by methods that are represented as variables declared inside of a class declaration but outside the bodies of the method declarations.

Q: Client of an object
A: Any class that calls the object's methods.

Q: A set method
A: Assigns values to a variable

Q: A get method
A: Obtains the values of a variable

Q: Special method automatically called by the JVM when it executes an application.
A: method "main"

Q: Keyword indicating that the method can be called by methods of other classes.
A: keyword "public"

Q: Indicates that a method will perform a task, but will not return data.
A: keyword "void"

Q: By convention, method names begin with a [...] first letter and and subsequent words begin with a [...]
A: lowercase; capital letter.

Q: Keyword that creates an object of a class.
A: keyword "new"

Q: Details that a method might require to perform its task.
A: Parameter

Q: Indicates that variables and methods are only available to the class in which they are declared.
A: keyword "private"

Q: List of Primitive Types:
A: boolean, byte, char, short, int, long, float, double

Q: Parameter
A: additional information needed by a method so that it can perform its task

Q: Perameter List
A: any number of perameters, including zero, seperated by commas.

Q: nextLine Method
A: takes all user input upto, but not including, the new line command (Enter key) and returns that input in a string.

Q: next Method
A: takes in user input untill a white space is read, then returns what was read in the form of a string

Q: classes that are in the same package ,by default, because they are in the same directory
A: default packages

Q: Allows you to bypas import commands
A: fully qualifiedd class name

Q: Where do you place instance variables
A: Before the body, after the class declaration

Q: Known as "data hiding"
A: "private" modifier

Q: "set" methods do not return data
A: void return type

Q: "get" methods main job
A: to return data

Q: variables that can only be used in particular methods
A: local variables

Q: another name for instance variable
A: fields

Q: additional information for methods is placed in...
A: parameters

Q: a method used to initialize an objects data
A: constructor

Q: the term "vpid" is a what?
A: return type

Q: The keywords "public" and "private" are?
A: access modifiers

Q: A constructors name must match the ___ name?
A: class'

Q: What does the word "new" do?
A: creates a new object of a class

Q: this type of number has decimals in java
A: floating point number

Q: what does "JOptionPane" do?
A: creates prebuilt dialogue boxes.

Q: the keyword void indicates what?
A: a method will execute a task but will not return any information

Q: a parameter must specify which two things?
A: a type and a variable name

Q: conxstructors can specify parameters but cannot specify___?
A: return types

Q: what scanner method will return a double value?
A: nextDouble

Q: every method must have ?
A: { }