Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 1 (class (constructor (no return type (NOTE: if it looks like a…
Chapter 1
class
-
-
if declared public, need to match the file name
-
constructor
no return type
NOTE: if it looks like a constructor but it has a return type, it's not a constructor
-
-
-
-
order of initialization
- Fields and instance initializer blocks are run in the order in which they appear in the file.
- The constructor runs after all fields and instance initializer blocks have run.
-
primitives
-
-
a float is 32 bytes and double is 64 bytes, but a float needs to have f at the end to be read as float else it would be assumed as double, float test = 12.32f;
package
if a class is on the same package, an import is not needed
-
running with terminal
javac Zoo.java
java Zoo
notice that when running the .class you don't need to add the .class and you can just use the filename
-
-
-
-