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

How much cpu time does an applet get, How much CPU time does an applet get?...

How much CPU time does an applet get? One of the few legitimate concerns about hostile applets is excessive use of CPU time. It is possible on a non-preemptively multitasking s

Describe the final keyword, Describe the final keyword ? The final key...

Describe the final keyword ? The final keyword is used in various different contexts as a modifier meaning in which what it modifies cannot be changed in a few sense. final c

Describe methods of basic applet life cycle, Describe methods of Basic Appl...

Describe methods of Basic Applet Life Cycle ? All applets have the subsequent four methods: public void init(); public void start(); public void stop(); public void destroy();

Stream as an object, What interface must an object implement before it can ...

What interface must an object implement before it can be written to a stream as an object?      Ans) An object must execute the Serializable or Externalizable interface before i

Sum of six digits, How do I write a java program that enters a six digit nu...

How do I write a java program that enters a six digit number and takes the sum of the six digits?

What are the basic components of jsp?, There are two different types of dat...

There are two different types of data in a JSP page. 1. Static part which occurs copied directly to the response by the JSP Engine. 2. Dynamic part, which have anything that

Describe inner classes in java, Describe Inner Classes in java? An inne...

Describe Inner Classes in java? An inner class is a class whose body is described inside another class, referred to as the top-level class. For instance: public class Queue {

Write a java code to explain else if, Write a java code to explain Else If ...

Write a java code to explain Else If ? if statements are not limited to two cases. You can merge an else and an if to form an else if and test a overall range of mutually exclu

Java., the textbok is Introduction to Java™ Programming, Brief Version, Eig...

the textbok is Introduction to Java™ Programming, Brief Version, Eighth Edition Week 8 Exercises Chapter 8 Programming Exercises from Pages 295 - 299. Do Exercise Problems 2,

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