Search This Blog

save java programs with".java" extension

examples :

helloworld.java
sample.java
match.java
send-mail.java

quick links

wrapperint in java

wrapper classes  are :
Byte
Short
Integer
long
Float
Double
Character
Boolean


class wrapperint
{
public static void main(String args[])
{
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int c=a+b;
System.out.println("sum :"+c);
}
}

/* save with : wrapperint.java

* open command prompt.
* open directory where you saved your java file.

* type the fallowing and don't type "press enter)" :

javac wrapperint.java (press enter)

java wrapperint 100 200 (press enter)

note : ou can also use as fallows
 double a = Double.parseInt(args[0]);
 float a = Float .parseInt(args[0]);
 as like this


* /