Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- public class LessonOne
- {
- @SuppressWarnings("unused")
- public static void main(String [] args) {
- // this code prints out Hello World in console
- //System.out.print("Hello World") ;
- // single line comment
- //Hi
- /* Hi how are you?
- * this is a multi comment
- */
- // Creating a Sting Variable
- //String name = ("Java");
- // This line of code will print "false" because java is case-sensitive.
- //System.out.print(name.equals("java")) ;
- // Creating a Sting Variable
- //String name1 = ("Java");
- // This line of code will print "true" because java is case-sensitive . Both Java and Java are exactly the same
- //System.out.print(name1.equals("Java")) ;
- // Int data types, they
- //int num = 10;
- //int num1 = -5;
- //int num2 =4;
- // char data type
- //char answer = 'e';
- // primitive data types
- /* int
- * char
- * boolean
- * byte
- * long
- * short
- * double
- * float
- * null
- */
- //byte c= 20;
- //static Typing
- /* The type of variable is checked at
- * compile time. This is known as static typing
- * It has the advantage of catching the errors at compile time rather than at execution time.
- */
- //basic math
- /* notes
- * + addition
- * - subtraction
- * * multiplication
- * / division
- */
- // int a =20;
- //int b = 10;
- //int result;
- //result = a + b;
- // comparison operations
- /* notes
- * > greater than
- * < less than
- * >= greater or equal to
- * <= less than or equal to
- * == equal to
- * != not equal to
- */
- // int d =20;
- //int e = 10;
- // boolean results;
- //results = e > d;
- // boolean result will be true or false
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment