Add two Int Number Core Java Program

Add two Int Number Core Java Program


class  AddTwoInts
{
public static void main(String[] args) 
{
int a = 10;
int b = 20;

int c = a + b;

int i1 = 10;
float  f1 = 20;

float f2 = i1 + f1;
//int i  = i1 + f1;
//=> float f2 = 10 + 20.0f;
//=> float f2 = 10.0f + 20.0f;
//=> float f2 = 30.0f;

byte b1 = 10; 
byte b2 = 20; 
byte b 3 = b1 + b2;




System.out.println(c);
System.out.println(f2);
}
}

Share this

Related Posts

Previous
Next Post »

Recent