Literals in Java

 

package com.company;

public class mbliteral {

  public static void main(String[] args) {
  byte age = 33;
  int age2 = 33;
  short age3 = 35;
  long Milan = 33333333333L;
  char ch = 'M';
  float f = 3.3f;
  double d= 3.33;
  boolean a = true;
  System.out.println(age);
  System.out.println(age2);
  System.out.println(age3);
  System.out.println(Milan);
  System.out.println(f);
System.out.println(d);
System.out.println(a);
String str = "Milan";
System.out.println( str);
  }

}

Comments

Popular posts from this blog

Chapter 1 Practise set

Percentage Calculator with user input