Chapter I Flashcards
- Understanding java technology and environment - Creating a simple java program - Describing and using objects and classes
What are the key (identifying) benefits of Java
- Object-Oriented
- Encapsulation
- Platform independent
- Robust
- Simple
- Secure
- Multithreaded
- Backward Compatibility
An Object is a runtime instance of a class in memory
Yes
A reference is
A variable that points to an object
Methods and fields are
Called the members of the class
The method name and parameter types are called
The method signature
Main method signature
public static void main (String[] args){}
public static void main (String… args){}
public static void main (String options[]){}
Each file can contain how many public class
Only one public class
public, private are
Access modifier
varargs is
variable argument lists
Compile command
javac -d classes packagea/ClassA.java packageb/ClassB.java
Run command
java -cp classes packageb.ClassB
java -classpath classes packageb.ClassB
java –class-path classes packageb.ClassB
Create a jar command
jar -cvf myNewFile.jar .
jar –create –verbose –file myNewFile.jar .
jar -cvf myNewFile.jar -C dir .