Write a program to add integer value, JAVA Programming

Assignment Help:

Write a program to add integer value?

class AddInts {
public static void main (String args[]) {
int i = 1;
int j = 2;
System.out.println("i is " + i);
System.out.println("j is " + j);
int k = i + j;
System.out.println("i + j is " + k);
k = i - j;
System.out.println("i - j is " + k);
}
}
Here's what happens while you run AddInts:
$ javac AddInts.java
$ java AddInts
i is 1
j is 2
i + j is 3
i - j is -1


Related Discussions:- Write a program to add integer value

Write a code in java to explain the while loop in java, Write a code in jav...

Write a code in java to explain the while loop in Java? // This is the Hello program in Java class Hello { public static void main (String args[]) { System.out.print("

Describe remote objects?, Describe Remote Objects A Remote Object is o...

Describe Remote Objects A Remote Object is one whose functions can be called from another JVM. A remote object class must execute the Remote interface. A RMI Server is an appl

Flash games, have some assignments and i want help with them. thanks

have some assignments and i want help with them. thanks

What is mixing data types, What is Mixing Data Types? As well as mergin...

What is Mixing Data Types? As well as merging various operations, you can mix and match various numeric data types on the similar line. The program below uses both ints and dou

Which is better to store data as attributes or as elements? , A question ri...

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element. 1. Using  an  elemen

For in statement, It is a distinct type of loop, used to iterate through th...

It is a distinct type of loop, used to iterate through the properties of an object or the elements of an array. For instance assume the following statement that loops through th

Exercise\servletexercise, Ask question # Write a servlet to display a table...

Ask question # Write a servlet to display a table that contains factorials for the numbers from 0 to 10,

What is actionmapping, Action mapping having all the deployment information...

Action mapping having all the deployment information for a particular Action bean. This class is to verify where the results of the Action will be sent once its processing is done.

Write an application for a video store , a. Write an application for a vide...

a. Write an application for a video store. Place the names of 10 of your favorite movies in a combo box. Let the user select a movie to rent. Let the user select a movie to rent. D

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd