Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
27 Cards in this Set
- Front
- Back
Class |
Describe all the parts and characteristics of one of basic building blocks for Java |
|
Object |
A runtime instance of a class in memory. All the various objects of all the different classes represent the state of your program. |
|
Methods |
Functions or procedures in other languages |
|
Fields |
More generally known as variables. |
|
Members of the class |
Java classes with two primary elements: *Fields *Methods |
|
Keyword |
A word with special meaning |
|
Void |
Void means that no value at all is returned -This method requires information be supplied to it from the calling method |
|
Parameter |
Information be supplied to it from the calling method. |
|
setName has one parameter named ______ |
newName |
|
newName is a type of _______ |
String |
|
Method signature |
Is the full declaration of a method |
|
In this example, can you identify the return type and parameters? public int numberVisitors(int month) |
* The return type is int, which is a numeric type. *There's one parameter named month, which is of type int as well. |
|
What are the three types of comments in Java?
|
* Single-line Comment * Multiple-line comment *Javadoc comments |
|
What type of code is this: / / comment until end of line |
A single-line comment |
|
What type of code is this: /* Multiple * line comment */ |
A Multiple-line comment |
|
What type of code is: /** * Javadoc multiple-line comment * @author Jeanne and Scott */ |
A Javadoc Multiple-Line Comment |
|
How many classes are listed? 1: public class Animal { 2: private String name; 3: } 4: class Animal2 { 5: } |
- 2 Classes are listed: |
|
main() method |
A main() method is the gateway between the startup of a Java process, which is managed by the Java Virtual Machine (JVM), and the beginning of the programmer's code. |
|
Java Virtual Machine (JVM) |
The JVM calls on the underlying system to allocate memory and CPU time, access files, and so on. |
|
What does bytecode cover |
Bytecode consists of instructions that the JVM knows how to execute. Notice that we must omit the .classextension to run Zoo.java because the period has a reserved meaning in the JVM. |
|
What are the subset of the simple rules: |
*Each file can contain only one class. *The filename must match the class name, including case, and have a .java extension. |
|
Access Modifier |
It declares this method's level of exposure to potential callers in the program. |
|
Static |
This binds a method to its class so it can be called by just the class name, as in, for example, Zoo.main(). Java doesn't need to create an object to call the main() method |
|
What keyword represents the return type. |
void |
|
The variable name args hints that this list contains values that were read in ______ |
(arguments) |
|
Below which arg accesses the first elements in array public class Zoo { public static void main(String[] args) { System.out.println(args[0]); System.out.println(args[1]); } } |
args[0] accesses the first element of the array |
|
What happens if you don't pass in enough arguments? |
There's no second argument! |