CanadianGamer

lessonone.java

Jul 12th, 2020
1,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.35 KB | None | 0 0
  1. package main;
  2.  
  3. public class LessonOne
  4. {
  5.     @SuppressWarnings("unused")
  6.     public static void main(String [] args) {
  7.         // this code prints out Hello World in console
  8.          //System.out.print("Hello World") ;
  9.          
  10.          // single line comment
  11.          //Hi
  12.          
  13.          /* Hi how are you?
  14.           * this is a multi comment
  15.           */
  16.         // Creating a Sting Variable
  17.          //String name = ("Java");
  18.         // This line of code will print "false" because java is case-sensitive.
  19.          //System.out.print(name.equals("java")) ;
  20.          
  21.          
  22.           // Creating a Sting Variable
  23.          //String name1 = ("Java");
  24.         // This line of code will print "true" because java is case-sensitive . Both Java and Java are exactly the same
  25.          //System.out.print(name1.equals("Java")) ;
  26.          
  27.          
  28.  
  29.     // Int data types, they
  30.        
  31.         //int num = 10;  
  32.         //int num1 = -5;
  33.         //int num2 =4;
  34.        
  35.        //  char data type
  36.         //char answer = 'e';
  37.              
  38.        
  39.        // primitive data types
  40.         /* int
  41.          * char
  42.          * boolean
  43.          * byte    
  44.          * long
  45.          * short
  46.          * double
  47.          * float      
  48.          * null
  49.          */
  50.         //byte c= 20;
  51.        
  52.        
  53.        
  54.         //static Typing
  55.         /* The type of variable is checked at
  56.          * compile time. This is known as static typing
  57.          * It has the advantage of catching the errors at compile time rather than at execution time.
  58.          */
  59.        
  60.        
  61.        
  62.         //basic math
  63.         /* notes
  64.          *  + addition
  65.          *  - subtraction
  66.          *  * multiplication
  67.          *  / division
  68.          */
  69.        // int a =20;
  70.         //int b = 10;
  71.        
  72.      
  73.        
  74.         //int result;
  75.        
  76.         //result = a + b;
  77.        
  78.         // comparison operations
  79.         /* notes
  80.          * > greater than
  81.          * < less than
  82.          * >= greater or equal to
  83.          * <= less than or equal to
  84.          * == equal to
  85.          * != not equal to
  86.          */
  87.        
  88.        // int d =20;
  89.         //int e = 10;
  90.        
  91.        // boolean results;
  92.        
  93.         //results = e > d;
  94.        
  95.         // boolean result will be true or false
  96.        
  97.        
  98.        
  99.        
  100.        
  101.        
  102.        
  103.        
  104.        
  105.     }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment