Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

subtract two variables in java

public class Subtraction{
  	//simple subtraction method in Java
	public static void main(String args[]){
    	int x = 3; // initializing first variable with a value
      	int y = 1; // initializing second variable
      	
      	int answer = x - y; // new variable which is subtracting two variables x and y
      	
      	System.out.println( x + " - " + y + " = " + answer );
      	// printing the answer of variables on the console
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java two constructors 
Java :: TestNG Data Provider 
Java :: stream get double value from map 
Java :: what are construtcor java 
Java :: private void loadmaze(string mazefile) 
Java :: getarguments().getstring updates android 
Java :: rstudio boxplot coloring 
Java :: how to implement count steps in android 
Java :: bebra 
Java :: android detect screen on by intent broadcast receiver 
Java :: jaspersoft masking 
Java :: how to use advanced math in java 
Java :: public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); } } 
Java :: java yaml unchecked cast 
Java :: jagermeister price in bangalore 
Java :: give text color and font size in android string 
Java :: java.applet defines how many interfaces 
Java :: demo application using stomp js and node js 
Java :: crazy error 
Java :: java producer consumer queue 
Java :: request.iter_content(1024 * 1024) 
Java :: take string , double and int value from useer using java 
Java :: java int data type 
Java :: before first method in jdbc 
Java :: are inner classes inherited 
Java :: Java Add elements to a LinkedList 
Java :: what is resource bundle class in java 
Java :: how much epsom salt should strawberries need 
Java :: what is instance block in java 
Java :: java param.ExStyle |= 0x08000000; 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =