මේ video එකෙන් කතා කරන්නේ java වල තියෙන Variable සහ Data type ගැන.



Excercises




public class MyClass {
  public static void main(String[] args) {
    String name = "John";
    System.out.println(name);
  }
}

public class MyClass {
  public static void main(String[] args) {
    int myNum = 15;
    System.out.println(myNum);
  }
}


public class MyClass {
  public static void main(String[] args) {
    int myNum;
    myNum = 15;
    System.out.println(myNum);
  }
}

public class MyClass {
  public static void main(String[] args) {
    int myNum = 15;
    myNum = 20;  // myNum is now 20
    System.out.println(myNum);
  }
}

public class MyClass {
  public static void main(String[] args) {
    int myNum = 5;
    float myFloatNum = 5.99f;
    char myLetter = 'D';
    boolean myBool = true;
    String myText = "Hello";
    System.out.println(myNum);
    System.out.println(myFloatNum);
    System.out.println(myLetter);
    System.out.println(myBool);
    System.out.println(myText);
  }
}