Data type addition and default values
int based datatype
Default values of integer based types
public class IntTypes { static int a3; static short s1; static byte b1; static long l1; /** * This method demonstrates addition of two numbers * integers and also explains about a default value a3 of an integer * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int a1 =10; int a2 =20; System.out.println("Sum of two numbers 10 and 20 is " + ( a1 + a2) ); System.out.println( "default value of int " +a3 ); System.out.println( "default value of byte " +b1 ); System.out.println( "default value of short " + s1 ); System.out.println( "default value of ling " + l1 ); } } /** * output println Sum of two numbers 10 and 20 is 30 default value of int 0 default value of byte 0 default value of short 0 default value of ling 0 */
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/