Last active
October 31, 2024 23:50
-
-
Save caleman9791/304c9eea6c767f70be9f234e39d77687 to your computer and use it in GitHub Desktop.
Revisions
-
caleman9791 revised this gist
Oct 31, 2024 . No changes.There are no files selected for viewing
-
caleman9791 revised this gist
Oct 31, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -22,14 +22,14 @@ public static void main(String[] args) { System.out.println(f1); System.out.println(d1); // boolean data type // Tipo de dato para valores verdadero o falso "true or false" // char data type // El tipo de datos char se utiliza para almacenar un solo carácter. // El carácter debe estar entre comillas simples, como "A" o "c": // byte data type // El tipo de datos byte puede almacenar números enteros de -128 a 127. // Se puede utilizar en lugar de int u otros tipos de enteros para ahorrar memoria cuando -
caleman9791 created this gist
Oct 31, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ package modulo00007; public class modulo00007 { public static void main(String[] args) { int myNum = 5; // Integer (whole number) float myFloatNum = 5.99f; // Floating point number char myLetter = 'D'; // Character boolean myBool = true; // Boolean String myText = "Hello"; // String System.out.println(myNum); System.out.println(myFloatNum); System.out.println(myLetter); System.out.println(myBool); System.out.println(myText); // System.out.println(myNum); float f1 = 35e3f; double d1 = 12E4d; System.out.println(f1); System.out.println(d1); // ---------------------------------------------------------------------------------------- // boolean data type // Tipo de dato para valores verdadero o falso "true or false" // ---------------------------------------------------------------------------------------- // char data type // El tipo de datos char se utiliza para almacenar un solo carácter. // El carácter debe estar entre comillas simples, como "A" o "c": // ---------------------------------------------------------------------------------------- // byte data type // El tipo de datos byte puede almacenar números enteros de -128 a 127. // Se puede utilizar en lugar de int u otros tipos de enteros para ahorrar memoria cuando // se está seguro de que el valor estará entre -128 y 127: // short data type // El tipo de datos corto puede almacenar números enteros desde -32768 hasta 32767: // int data type // El tipo de datos int puede almacenar números enteros desde -2147483648 hasta 2147483647. // En general, y en nuestro tutorial, el tipo de datos int es el tipo de datos preferido // cuando creamos variables con un valor numérico. // long data type // El tipo de datos long puede almacenar números enteros desde -9223372036854775808 hasta // 9223372036854775807. Se utiliza cuando int no es lo suficientemente grande para almacenar // el valor. Tenga en cuenta que debe terminar el valor con una "L": // float data type // double data type // Debe utilizar un tipo de punto flotante siempre que necesite un número con un decimal, // como 9,99 o 3,14515. Los tipos de datos float y double pueden almacenar números fraccionarios. // Tenga en cuenta que debe finalizar el valor con una "f" para los float y una "d" para los doubles } }