This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IdentificadoresJava { | |
public static void main(String[] args) { | |
System.out.println("El tipo de datos: " + Byte.TYPE); | |
System.out.print("Está formado por: " + Byte.BYTES + " Bytes\n" ); | |
System.out.print("Un byte está formado por: " + Byte.SIZE + " Bits" + "\nSu Rango va del: " + Byte.MIN_VALUE + " a " + Byte.MAX_VALUE); | |
//PODEMOS IR CONCATENANDO TEXTO EN LA MISMA LÍNEA SI OS FIJAÍS CON EL \N HACEMOS EL SALTO DE LÍNEA. EL \N ES CONSIDERA TEXTO Y DEBE IR ENTRE COMILLAS. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IdentificadoresJava | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("El tipo de datos: " + Byte.TYPE); | |
System.out.print("Está formado por: " + Byte.BYTES + " Bytes\n" ); | |
System.out.print("Un byte está formado por: " + Byte.SIZE + " Bits" + "\nSu Rango va del: " + Byte.MIN_VALUE + " a " + Byte.MAX_VALUE); | |
//PODEMOS IR CONCATENANDO TEXTO EN LA MISMA LÍNEA SI OS FIJAÍS CON EL \N HACEMOS EL SALTO DE LÍNEA. EL \N ES CONSIDERA TEXTO Y DEBE IR ENTRE COMILLAS. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IdentificadoresJava | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("\tRango byte desde: " + Byte.MIN_VALUE + "\t" + "hasta: " + Byte.MAX_VALUE); | |
System.out.println("\t---------------------------------------------------------------------------------"); | |
System.out.println("\tRango short desde: " + Short.MIN_VALUE + "\thasta: " + Short.MAX_VALUE); | |
System.out.println("\t---------------------------------------------------------------------------------"); | |
System.out.println("\tRango int desde: " + Integer.MIN_VALUE + "\thasta: " + Integer.MAX_VALUE); | |
System.out.println("\t---------------------------------------------------------------------------------"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IdentificadoresJava | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("Mensaje con Salto de línea (LN)"); //Mensaje con salto de línea println | |
System.out.println("Mensaje con Salto de línea (LN)"); //Mensaje con salto de línea println | |
System.out.print("Fila "); //Mensaje sin salto de línea | |
System.out.print("Fila "); //Mensaje sin salto de línea | |
System.out.print("Fila \n"); //Mensaje con salto de línea \n | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IdentificadoresJava | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("Mensaje con Salto de línea (LN)"); //Mensaje con salto de línea println | |
System.out.println("Mensaje con Salto de línea (LN)\r"); //Mensaje con salto de línea println | |
System.out.print("Fila "); //Mensaje sin salto de línea | |
System.out.print("Fila "); //Mensaje sin salto de línea | |
System.out.print("Fila \n"); //Mensaje con salto de línea \n | |
System.out.print("Fila "); //Mensaje sin salto de línea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Constantes | |
{ | |
public static void main(String[] args) | |
{ | |
final byte a = 1; | |
System.out.println(a); | |
final short b = 2; | |
System.out.println(b); | |
final int c = 3; | |
System.out.println(c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ejer1Ap1 | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("Hola, mi nombre es David"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ejer2Ap1 | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("Hola, mi nombre es David"); //David Apellido1 Apellido2 | |
System.out.println("\tTengo 26 años"); //13-02-1991 | |
System.out.println("\t\tY vivo en España"); //Barcelona | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ejer3{ | |
public static void main(String[] args) { | |
/* | |
System.out.println("Hola, mi nombre es David"); //David Apellido1 Apellido2 | |
System.out.println("\tTengo 26 años"); //13-02-1991 | |
System.out.println("\t\tY vivo en España"); //Barcelona | |
*/ | |
System.out.print("Mi nombre es David\n" + "\tTengo 26 años\n\t\t" + "Y vivo en España"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ejer4{ | |
public static void main(String[] args) { | |
System.out.println("Rango de datos de un dato de tipo " + Byte.TYPE + ".\n\t Bytes totales: " | |
+ Byte.BYTES + "\n\t Bits totales: " + "\n\t Tamaño Mínimo: " + Byte.MIN_VALUE | |
+ "\n\t Tamaño Máximo: " + Byte.MAX_VALUE); | |
} | |
} |
OlderNewer