Title: JavaChapter6

Q: The class [...] declares two fields that represent commonly used mathematical constants: [...] (3.14159...) and [...] (2.71828...)
A: Math; Math.PI; Math.E

Q: How to call a class's method
A: ClassName.methodName(arguments)

Q: main method
A: no objects of the class have been created, have to declare it as static so can invoke it without creating an instance of the class.

Q: String concatenation
A: assembly of string objects into larger strings

Q: toString Method
A: returns a string representation of the object

Q: Class Random is from what package?
A: java.util

Q: pseudorandom numbers
A: not truly random, calculated from a complex calculation, using the time to seed it.

Q: Format for generating a random number
A: Random randomNumbers = new Random();
int randomValue = randomNumbers.nextInt(#);
# is the range of possible numbers.
Ex: 6 means numbers 0-5 could be generated

Q: scaling factor
A: represents the number of unique values that nextInt should produce

Q: Random randomNumbers = new Random( seedValue );
A: seeds the random-number calculation so the same seedValue is used every time and same set of random numers is created everytime - used for debugging

Q: Methods
A: Sometimes called "functions" or "procedures in other languages, this helps you modularize a program by separating its tasks into self-contained units.

Q: Class Method
A: A method that performs a task that does not depend on the contents of any object.

Q: Stack
A: A data structure where the last item inserted is the first item used in the program. (Also known as LIFO data structures)

Q: Program-Execution Stack
A: A data structure to let the method called know how to return to its caller.

Q: Stack Over Flow
A: An error that occurs when more method calls occur than can have their activation records stored.

Q: Argument Promotion
A: Converting an argument's value to the type the method expects to recieve in its corresponding parameter.

Q: Placing a method outside [...] or [...] is a [...].
A: the body of a class declaration; inside the body of another method; syntax error

Redeclaring a parameter as a local variable in the method's body is a compilation error.

Q: Forgetting to [...] a value from a [...] that should return a value is a [...].
A: return; method; compilation error

Q: software reusability
A: using existing methods as building blocks to create new programs

Q: class variables
A: static fields

Q: any [...] declared with keyword [...] is [...]
A: field; final; constant

Q: enumeration
A: declares a set of constants represented by identifiers

Q: activation record
A: the memory for the local variables used in each invoction of a method durring an execution

Q: java.applet
A: java package that contains a class and several interfaces to create java applets.

Q: modules
A: small pieces of code that are simple and easy to maintain

Q: java.awt
A: the java package called the java abstract window toolkit package which contains the classes and interfaces required to create java GUIs in early versions of java.

Q: java.awt.event
A: The java abstract window toolkit event package which contains classes and interfaces that enable event handling for GUI components in both the java.awt and javax.swing packages.

Q: javax.swing
A: the java swing GUI components package that contains classes and interfaces for java's swing GUI components that provide support for portable GUIs.

Q: java.awt.geom
A: the Java 2D shapes package that contains classes and interfaces for working with java's two dimentional graphics capabilities.

Q: java.io
A: the java input/output package that contains classes and interfaces that enable programs to input and output data.

Q: java.lang
A: the javva language package that contains classes and interfaces that are required by many java programs. This package is imported into all programs by the compiler.

Q: The object class [...] allows for methods to access the Math.Objects to produce a random boolean, float, double, int, long, or short
A: Random

Q: java.net
A: the java networking package, which contains classes and interfaces that enable programs to communicate via computer networks like the internet.

Q: java.sql
A: that JDBC package, which conatins classes and interfaces for working with databases.

Q: [...] is process of using a random-number generator to produce a different values for every execution
A: Seeding

Q: The [...] of a declaration is the portion of the program that can refer to the declared entity by its name
A: scope

Q: Java Application Programming Interface
A: predefined classes and methods available online in a library

Q: what is an example of a command line argument?
A: classname

Q: how would you code a six sided die?
A: die = randomNumbers. nextInt(6) + 1

Q: how does the compiler distinguish between overloaded methods
A: by the methods signature

Q: what words are used to represent a boolean value concatenated with a string?
A: true and false

Q: The return address of a [...] is pushed onto the [...].
A: calling method; program-execution stack

Q: Promotion rules
A: The rules that specify which conversions are allowed (i.e. from int to double).

Random method nextInt generates a random int value in the range -2,147,483,648 to 2,147,483,648.

Shadowing is when a local variable or parameter in a method has the same name as a field of the class so the field is "hidden" until the block terminates.

Q: a method that is applied to the class as a whole
A: static method

Q: method to take the square root of a number
A: Math.sqrt()

Q: method to get maximum of a given set of numbers
A: Math.max()

Q: What are the 3 ways to declare a method
A: (1) using a method name to call another method of the same class, (2) using a variable that contains a reference to an object followed by a dot and the method name, and (3) using the class name and dot to call a static method

Q: Random method nextInt generates
A: speudorandom numbers, a sequence of values produced by a complex mathematical calculation

Q: element of chance
A: the possibility that luck will convert a pocketful of money into a mountain of wealth