CH. 3 INTRO TO CLASSES, OBJECTS, METHODS, STRINGS Flashcards
Each class declaration that begins with keyword _____
must be stored in a file that has exactly the same name as the class and ends with the .java file name extension.
public
Keyword _____ in a class declaration is followed immediately by the class’s name.
class
Ex: pulbic class Welcome1
Keyword ____ requests memory from teh system to store an object, then calls the corresponding class’s constructor to initialize the object
new
EACH PARAMETER MUST SPECIFY BOTH
A ____ AND A ____
TYPE AND A NAME
BY DEFAULT, CLASSES THAT ARE COMPILED IN THE SAME DIRECTORY ARE CONSIDERED TO BE IN THE SAME PACKAGE, KNOWN AS THE _____
DEFAULT PACKAGE
WHEN EACH OBJECT OF A CLASS MAINTAINS ITS OWN COPY OF AN ATTRIBUTE, THE FIELD THAT REPRESENTS THE ATTRIBUTE IS ALSO KNOWN AS A ___________
INSTANCE VARIABLE
JAVA PROVIDES TWO PRIMITIVE TYPES FOR STORING FLOATING POINT NUMBERS IN MEMORY:
______ AND _____
FLOAT AND DOUBLE
VARIABLES OF TYPE DOUBLE REPRESENT ______
FLOATING POINT NUMBERS
DOUBLE PRECISION
SCANNER METHOD ____ RETURNS A DOUBLE VALUE
nextDOUBLE
KEYWORD PUBLIC IS AN ACCESS ______.
MODIFIER
RETURN TYPE _____ INDICATES THAT A METHOD WILL NOT RETURN A VALUE
VOID
SCANNER METHOD _______
READS CHARACTERS UNTIL IT ENCOUNTERS A NEWLINE CHARACTER, THEN RETURNS THOSE CHARACTERS AS A STRING
nextLine
CLASS STRING IS IN PACKAGE ______
java.lang
A(n) ______ is not required if you always refer to a class with its fully qualified class name.
import declaration
A ______ IS A NUMBER WITH A DECIMAL POINT, SUCH AS 7.33, 0.9775 OR 1000.0123
FLOATING POINT NUMBER