Chapter 1 Java Building Blocks Flashcards
Java Basics Working with Java Data Types
What is an object?
An object is a runtime instance of a class in memory.
What are the two primary elements in Java classes?
Methods and fields. Together these are called the members of the class.
[Blank] holds the state of the program.
Variables (Fields)
[Blank] operates on the state of the program.
Methods
Java calls a word with special meaning a [Blank].
Keyword
Public classes in Java means?
The class can be used by other classes.
A method is
an operation that can be called again.
Return type void means
that no value at all is returned.
Methods that require information be supplied to it from the calling method is called a [Blank]
parameter
The full declaration of a method is called [Blank]
method signature
What are the the three type of comments?
Single line comments: //
Multiple line comment:
/*
*
*/
Javadoc comment /** * * */
What is a main() method?
A Java program begins execution with its main() method. It is the gateway between the startup of a Java process, which is managed by the JVM (Java Virtual Machine).
The file must have what extension to be able to be compiled as Java code?
.java
The name of the file must also match the name of the class.
The compiler turns a .java file into what type of file?
.class
What is bytecode?
Bytecode is a class file which consists of instructions that the JVM knows how to execute.
What is method access modifier?
It declares the method’s level of exposure to potential callers in the program.
The keyword [Blank] binds a method to its class so it can be called by just the class name.
static
[Blank] is a fixed size list of items that are all the same type.
Arrays
Command line arguments are treated as [Blank] objects, even if they represent another data type.
String
You need to have [Blank] to compile because it includes a compiler.
JDK (Java Development Kit)
You need [Blank] to run the code.
JRE (Java Run-time Environment)
Java class runs on [Blank] and therefore runs on any machine with Java rather than just the machine or operating system they happened to have been compiled on.
JVM (Java Virtual Machine)
Java code is organized into folders called [Blank]
packages
What does import statement do?
Import statement tell Java which packages to look in for classes.