Tutorials for Java ,Core java ,Advance java ,oracle ,HTML, CSS, JavaScript, Java and other programming language tutorial Learn Java tutorial for beginners with examples in eclipse online. Java tutorial point for core java, servlet, jsp, struts, spring, for learning web technologies online. Content includes tutorials and references relating to HTML, CSS, JavaScript, PHP, AngularJS, SQL, Bootstrap, Node.js, and jQuery this is a website like w3school tutorialspoint etc

Search This Blog

About

Header Ads

Monday, 9 April 2018

Add two Int Number Core Java Program

0 comments

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);
}
}

No comments:

Post a Comment