-El nombre de las clases deben empezar con myusculas
-No espacios en blanco o caracteres ,empiezan por una letra.
-El programa class empizan por llave de apertura y cierre.
-Todas lassentencias terminan en punto y coma.
-Un programa en java tiene  que ser compilado e interpretado.
Ejercicio 1
public class Ejercicio1 {
    public static void main(String args[]){
        System.out.print("Hola alumnos");
    }
}
Tipos primitivos
8 tipos de datos
Enteros 7 , 23000,564039
int 4bytes de espacio de almacenamiento.
short 2 bytes de espaio de alamcenamiento.
long 8 bytes de espacio de almacenamiento.
byte 1 byte de esapcio de almacenamiento.
Decimales Float
float 4 bytes de almacenamiento de 6 a 7 cifras.
double 8 bytes de almacenmamiento hasta 15 cifras.
Char Caracteres
Boolean true o false.evaluar condiciones
Tiene queir entre comillas simples
public class Ejercicio1 {
    public static void main(String args[]){
        byte edad;
        edad = 45;
        System.out.print(edad);
    }
}

public class Ejercicio1 {
    public static void main(String args[]){
        byte edad = 98;
        System.out.print(edad);
        edad = 45;
        System.out.print(edad);
    }
}
String name = "Alex";
System.out.println(name);
int myNum = 30;
System.out.println(myNum);

public class Main {
  public static void main(String[] args) {
    String name = "Alex";
    System.out.println("Hola mundo" + name);
  }
}
+ agregar variable a otra variable
String firstName = "Luis";
String lastName = "Perez";
String fullName = firstName + lastName;
System.out.println(fullName);
Multiples variables
int x = 7;
int y = 45;
int z = 2;
System.out.println(x + y + z);

int x = 4, y = 12, z = 24;
System.out.println(x + y + z);
mismo valor a la variable
int x, y, z;
x = y = z = 10;
System.out.println(x + y + z);
Tipos de datos
int myNum = 12;               // Integer (whole number)
float myFloatNum = 8,90f;    // Floating point number
char myLetter = 'A';         // Character
boolean myBool = true;       // Boolean
String myText = "Hola mundo";     // String
Tipos de datos primitivos
byte 1 byte Stores whole numbers from -128 to 127
short 2 bytes Stores whole numbers from -32,768 to 32,767
int 4 bytes Stores whole numbers from -2,147,483,648 to 2,147,483,647
long 8 bytes Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
float 4 bytes Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits
double 8 bytes Stores fractional numbers. Sufficient for storing 15 decimal digits
boolean 1 bit Stores true or false values
char 2 bytes Stores a single character/letter or ASCII values

byte myNum = 100;
System.out.println(myNum)

short myNum = 5000;
System.out.println(myNum);

int myNum = 100000;
System.out.println(myNum);

long myNum = 15000000000L;
System.out.println(myNum);

float myNum = 5.75f;
System.out.println(myNum);

double myNum = 19.99d;
System.out.println(myNum);
Char comillas simples
char myGrade = 'B';
System.out.println(myGrade);
A,B,C
char myVar1 = 65, myVar2 = 66, myVar3 = 67;
System.out.println(myVar1);
System.out.println(myVar2);
System.out.println(myVar3);
String
String greeting = "Hello World";
System.out.println(greeting);
Casting
public class Main {
  public static void main(String[] args) {
    int myInt = 9;
    double myDouble = myInt; // Automatic casting: int to double

    System.out.println(myInt);      // Outputs 9
    System.out.println(myDouble);   // Outputs 9.0
  }
}

public class Main {
  public static void main(String[] args) {
    double myDouble = 9.78d;
    int myInt = (int) myDouble; // Manual casting: double to int

    System.out.println(myDouble);   // Outputs 9.78
    System.out.println(myInt);      // Outputs 9
  }
}

Operadores aritmeticos
+ Addition Adds together two values x + y
- Subtraction Subtracts one value from another x - y
* Multiplication Multiplies two values x * y
/ Division Divides one value by another x / y
% Modulus Returns the division remainder x % y
++ Increment Increases the value of a variable by 1 ++x
-- Decrement Decreases the value of a variable by 1 --x
Operadores de asignaciòn
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x - 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
>>= x >>= 3 x = x >> 3
<<= x <<= 3 x = x << 3
Operadores de comparaciòn
== Equal to x == y
!= Not equal x != y
> Greater than x > y
< Less than x < y
>= Greater than or equal to x >= y
<= Less than or equal to x <= y
Operadores lògicos
&& Logical and Returns true if both statements are true x < 5 &&  x < 10
|| Logical or Returns true if one of the statements is true x < 5 || x < 4
! Logical not Reverse the result, returns false if the result is true
String
String txt = "Please locate where 'locate' occurs!";
System.out.println(txt.indexOf("locate")); // Outputs 7