Welcome to the Java course!
Java is one of the most popular, robust and in-demand languages in the industry. You will find it in banks, enterprise backends, Android apps and microservices.
Java
Robust · popular · in demand
Banking platforms
High availability
Enterprise backend
Massive systems
Android
Mobile applications
Microservices
Modern architectures
C / C++
programa.c One source code
.exe Windows x86
ELF Linux ARM
Mach-O macOS Apple Silicon
Three compilations, three different binaries.
Java · WORA
Programa.java One source code
Programa.class One single bytecode
JVM
Windows
JVM
Linux
JVM
macOS
JDK · Java Development Kit
Developersjavac jar javadoc jdb JRE · Java Runtime Environment
Runjava.lang java.util java.io java.net JVM · Java Virtual Machine
bytecodeClass Loader
Loads .class files into memory
Bytecode Verifier
Checks safety and integrity
JIT
Hot bytecode → native code
Garbage Collector
Frees unused objects
public class HolaMundo { public static void main(String[] args) { System.out.println("Hello, World from Java!"); } } HolaMundo.java Step 1 · create
javac HolaMundo.class Step 2 · compile
java Console
Hello, World from Java! Step 3 · run
Command line
$ java SaludoPersonalizado Command line
$ java SaludoPersonalizado Facundo String[] args "Facundo" [0] args.length == 0 args.length == 1 if (args.length > 0)
"Hello, " + args[0] + "! Welcome to Java engineering."
else
"Hello, Anonymous Developer! Pass your name as an argument."
PascalCase
Classes and interfaces
HolaMundo CuentaBancaria UsuarioService camelCase
Methods and variables
calculateTotal() userName initialBalance UPPER_SNAKE_CASE
Constants
MAX_RETRY_COUNT PI ;
Ends every statement
// ... Single line
/* ... */ Multi-line
/** ... */ Javadoc · API documentation
Local IDE
IntelliJ IDEA · Eclipse · VS Code
Online IDE
In the browser
Terminal
javac + java
java --version and javac --version compatibleJavadoc
Project JDK versionjava.base Package java.lang Class String Summary: purpose, inheritance, interfaces and general notes of the class.
public String substring(int beginIndex, int endIndex) Parameters
beginIndex inclusive · endIndex exclusive
Returns
A new String; does not modify the original
Throws
IndexOutOfBoundsException if the indices fall out of range or are reversed
Availability and migration signals
Linked types → follow the link and repeat the process: they are part of the contract too.
Mistake 1
class HolaMundo is public, should be declared in a file named HolaMundo.java The file is not named exactly like the public class (capitalization included).
Mistake 2
Error: Could not find or load main class HolaMundo You ran java HolaMundo.class instead of java HolaMundo, or you are not in the right directory.
Mistake 3
java.lang.ArrayIndexOutOfBoundsException You accessed args[0] without checking args.length > 0 and passed no arguments.
PerfilDesarrollador.java args.length >= 2 ?
========================================== Developer: Facundo Specialty: Java ========================================== Usage: java PerfilDesarrollador <YourName> <YourLanguage> CursoDeJava · l01_conceptos_basicos
Ej01HolaMundo Ej02SalidaEstandar Ej03ConstantesYConvenciones