Java Basics Flashcards
What does XXX mean in the following:
class XXX
Class or program name
What does each of these mean:
\
“\n”
“
n
Double slash
\”
\ = Next character is printable
“\n” = New line
“ = String Delimiter
n = Printable n
\ = Printable slash
\” = Printable
Any character used as an identifier must be?
Letter, digit, or underscore (_)
What can the first character in an identifier not be?
A digit
What is PascalCase and camalCase?
PascalCase = All the starting letters in a word are capitalized
camalCase = First letter of the first word is not capitalized but rest are
To which are PascalCase and camalCase conventionally assigned as?
PascalCase = Classes
camalCase = Variables and methods
For numeric data types, is it possible to convert from smaller to larger types but not reverse.
TRUE or FALSE
TRUE
What is a cast?
Forcing Java to make a data type conversion
What are constants and what are they conventionally assigned as?
Variables which’s values cannot be changed.
All UPPERCASE
What is a computer?
A machine that stores data (numbers, words, pictures), interacts with devices (monitors, speakers, mouse), and executes commands
What is programming?
Giving the computer a set of instructions to follow or execute
What is the processor in a computer responsible for?
Executing a variety of instructions
What did early model computers use to carry out translations?
Assembler
What does the assembler do?
Takes a sequence of characters such as iload and translates it into command code 21
What does a compiler do?
Translates high-level descriptions into machine instructions
In what year and who developed the coding language which they named “Green”?
1991 / James Gosling and Patrick Naughton at Sun Microsystems
What could the HotJava browser download and run?
Applets
In 1996, which two major companies supported Java?
Netscape and Microsoft
What is an object?
An entity you can manipulate by calling methods
What does every object belong to?
A class
What is the process of creating an object called?
Construction
What two elements does a class contain?
Variables and methods
What is a instance field?
A variable defined in a class for which every object has its own value
What is a variable?
A symbol in a class that can hold values
What does an instance field declaration consist of?
An access specifier (public or private)
The type of variable (int or string)
The name of the variable
What are the three things each variable has?
A name
A value
A type
What is the name you choose for a variable known as?
Identifier
What 3 things can an identifier start with?
A letter
An underscore
A dollar sign
A data type has ___ basic types and can be defined in ___ categories.
8 and 3
What are the 3 main categories for data types?
Numeric
Boolean
Characters
What are the 2 types of numeric data types?
An integer with no fraction and a floating point
What are the 4 types of integers?
Byte
Short
Long
Int
What does a variable of type char hold?
A single character
What do each of these mean:
\b
\t
\r
\b = Backspace
\t = Tab
\r= Carriage Return
Any expression in a parenthesis is evaluated first.
TRUE or FALSE
TRUE
Parenthesis can be nested, if so: the OUTERMOST expression is evaluated first.
TRUE or FALSE
FALSE (it is the innermost)
What are the 2 data types for floating points?
Double & Float