In this example we will show different data types in Java.
Source Code
package com.beginner.examples;
public class DataTypeExample {
public static void main(String args[]){
int i = 3; // int
float f = 0.57f; // float
char c = 'd'; // char
boolean b = true; // boolean
String s = "test"; // String
System.out.println(i);
System.out.println(f);
System.out.println(c);
System.out.println(b);
System.out.println(s);
}
}
Output:
3
0.57
d
true
test