Mapa mental
OCP 8
Contenido del mapa
OCP 8
Interfaces
- Every variable on an interface is final, public, static and cannot be changed this attributes.
- Every method on an interface will be an abstract and public and cannot be private or has a body
Classes
- Types of variables: instance, local, and static
- The local variables exists only into the "{}" context, for example: function void teste{ for (i = 0; i => 10; i++){ i++;} /** this code will make a erro of context **/ System.out. println(i); }
- Shadowing: is the process of hiding a instance variable by a local variable, for example: /** instance variable **/ String a =0; function void bla(String a){this.a = a;}
- You can have more than one class default in a file, however you can have only one public and the file need to has the same name of the public class
- Be aware of the file name and multiple public classes
- It's not possible to have a import after a class
- A method main can use a varArgs or array in its signature.
- Visibility between packages
- If you are trying to compile a class using another class that isn't into the package is necessary to Import for example: import test.HelloWorld or test.HelloWolrd
- By the way, look to the signature of the class. It needs to be public if it isn't you will have a problem because is default or private.
- Classes created in the default package can't be accessed by classes into sub-packages.
- When you are using a static method o variable beware of a sequence of the import for example: import static test.ClassStatic;
- If you are trying to compile a class using another class that isn't into the package is necessary to Import for example: import test.HelloWorld or test.HelloWolrd
- Types of variables: instance, local, and static
JDK means: Java Development Kit
- It's necessary with you wanna to develop without that you can't use for example the command "javac"
- You can pass a system property, which will be available in the programs, using java -D, for example: java -Dsystem=production HelloWorld
- You can use the variable global CLASSPATH to define where are your classes. It isn't a good pattern, however, you can use it as a parameter after the java command, as an example: java -classpath or java -cp java.HelloWorld
JRE means : Java Runtime Enviroment
- Into the JRE there is a Java virtual machine and if you wanna only to run a normal java program. You can only download the JRE.
Información
- Descripción
- Mapa Mental sobre OCP 8, creado por DIEGO ISIDORO el 11/09/2021.
- Creado por
- DIEGO ISIDORO
- Visitas
- 0
- Valoración