Skip to content

Instantly share code, notes, and snippets.

@gusdelact
Created March 31, 2022 01:27
Show Gist options
  • Save gusdelact/75fcabe76a11a9f6134eff5f4369b967 to your computer and use it in GitHub Desktop.
Save gusdelact/75fcabe76a11a9f6134eff5f4369b967 to your computer and use it in GitHub Desktop.
/***
* Write a description of class MainProgram here.
*
* @author awsgus
* @version 0.1
***/
public class MainProgram
{
/* that is a method that is call main
* this method receive a parameter that is called args
* this method doesn´t give any answer
*/
public static void main(String [] args)
{
System.out.println("Hello ATA 2022 and welcome new generation !!!");
System.out.println(args[0]);
//variables of native data types or primitive data types
byte data00 = 0; //8 bits ( 2 ^ 8 ) = 256 possible value from a range -127 to 127
System.out.println(data00);
data00 = 1;
char aCharacter = '@'; //a character can store 16 bits (2 bytes) ,65536 ( 2 ^ 16 ) possible values
short aShort = 2345; //an integer variable that can store 16 bits (2 bytes) ,65536 ( 2 ^ 16 ) possible values
int anInt = 23434; //an integer variable that can store 32 bits (4 bytes) ,4 294 967 296 ( 2 ^ 32 ) possible values
long aLong = 333333333L; // an integer variable that can store 64 bits (8 bytes) ,18 446 744 073 709 551 616 ( 2 ^ 64 ) possible values
float aFloat = 3.141519F; //a real varaible that can store 32 bits (4 bytes) ,4 294 967 296 ( 2 ^ 32 ) possible values
double aDouble = 3.141519E90; //a real varaible that can store 64 bits (16 bytes) ,4 294 967 296 ( 2 ^ 32 ) possible values
System.out.println(aCharacter);
System.out.println(aShort);
System.out.println(anInt);
System.out.println(aLong);
System.out.println(aFloat);
System.out.println(aDouble);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment