Intro to Classes, Objects, Methods and Strings Flashcards
a) A ___ method is a special method that you can call without first creating an object of the class in which it is declared.
a) static
b) Keyword \_\_\_ in a class declaration is followed immediately by the class’s name.
b) class
c) Keyword ___ requests memory from the system to store an object, then calls the
corresponding class’s constructor to initialize the object.
c) new
d) Each parameter must specify both a(n) ___ and a(n) ___ .
d) type, name
e) By default, classes that are compiled in the same directory are considered to be in the
same package, known as the ___ .
e) default package
f) When each object of a class maintains its own copy of an attribute, the field that represents the attribute is also known as a(n) ___ .
f) instance variable
g) Java provides two primitive types for storing floating-point numbers in memory: ___ and ___ .
g) float, double
h) Variables of type double represent ___ floating-point numbers.
h) double-precision
i) Scanner method ___ returns a double value.
i) nextDouble
j) Keyword public is an access ___ .
j) modifier
k) Return type ___ indicates that a method will not return a value.
k) void
l) Scanner method ___ reads characters until it encounters a newline character, then returns those characters as a String.
l) nextLine
m) Class String is in package ___ .
m) java.lang
n) A(n) ___ is not required if you always refer to a class with its fully qualified class name.
n) import declaration
o) A(n) ___ is a number with a decimal point , such as 7.33, 0.0975 or 1000.12345.
o) floating-point number