Oracle Certification Associate 1Z0-808: Difference between revisions
Line 78: | Line 78: | ||
|- | |- | ||
|Boolean | |Boolean | ||
| - | |||
|true | |true | ||
| | | | ||
|- | |||
| | |||
| | |||
| | |||
|- | |- | ||
|byte | |byte | ||
|8-bits | |8-bits | ||
|1 | |1 | ||
| | | | ||
|- | |- | ||
|short | |short | ||
Line 99: | Line 104: | ||
|64 bits | |64 bits | ||
|12 | |12 | ||
| | | | ||
|- | |- | ||
| | |||
| | |||
| | |||
|- | |- | ||
|float | |float | ||
|32-bits | |32-bits | ||
|123.45 | |123.45 | ||
| | | | ||
|- | |- | ||
|double | |double | ||
Line 115: | Line 123: | ||
|16-bits | |16-bits | ||
|'a' | |'a' | ||
| | | | ||
|} | |} |
Revision as of 17:52, 4 June 2020
Links
Installation
Windows
<source lang="Shell"> C:\Program Files\Java </source>
- Java Se Development Kit 8
- Java FX SDK
- Private JRE - Java Runtime Edition
- Java Mission Control Tools
Can also be installed:
- Development Tools
- Source Code
- Public JRE
Linux
<source lang="Shell"> sudo apt-get install oracle-java8-installer cd /usr/lib/jvm/java-8-oracle
- Java version
java -v
- Java Compiler
javac -version </source>
Basics
Main Method
<source lang="Java"> public static void main(String[] args]) </source>
Comments
<source lang="Java"> // Single Line Comment
/* Multi Line Comment
- /
/**
* Java Doc Comment * @param * @return */
</source>
Import Conflicts
<source lang="Java"> import java.util.*; import java.sql.*;
// ==> in code = COMPILATION error Date date; </source>
Static Imports
It is not a good idea to do static imports a lot in a projet because it makes difficult to understand where the methods / constants come from
- Static imports are for importing static members
- Classic imports are for importing classes
it can be used for methods and constants for example <source lang="Java"> import static java.lang,Math.*;
// Instead of typing Math.min(1,2); we can just type min(1,2) // Because of the static import </source>
Primitives
KeyWord | Size | Examples | Smallest Data-Type |
---|---|---|---|
Boolean | - | true | |
byte | 8-bits | 1 | |
short | 16-bits | 12 | comment |
int | 32-bits | 100 | By default all numbers in Java |
long | 64 bits | 12 | |
float | 32-bits | 123.45 | |
double | 64-bits | 123.45 | xxxx |
char | 16-bits | 'a' |