Free CoreJava Programs Source codes | Examples | Video Tutorials Download

Tuesday, January 20, 2009

Print Different Data Types Values Program

/**
* Please define different datatypes like char, boolean, string, float and print the same.
*/
class Datatypes
{
/**
* display the values specified in specified datatypes variables
*/
public static void display()
{
char ch='r';
boolean b=false;
String str="shreeji";
float f=1.1f;
System.out.println("char ch=" + ch);
System.out.println("boolean b=" + b);
System.out.println("String str=" + str);
System.out.println("float f=" + f);
}

/**
* exection begin from here
* @param args : for command line argument
*/
public static void main(String[] args)
{
display();
}
}

No comments:

Post a Comment

Followers