English, asked by supriyasingh6946, 1 year ago

addition of two numbers in java using method

Answers

Answered by pdd1
2
double a=Double.parseDouble(jTextField1.getText());
double b=Double.parseDouble(jTextField2.getText());
double c=a+b;
jTextField3.setText(" "+c);
Answered by thehelpingguy
1

Answer:

import java.io.*;

class Main {

 public static void main(String[] args)

   {

 

       // Declaring variable

       int num1 = 10, num2 = 20, sum;

 

       // Printing the variables

       System.out.print("The sum of ");

       System.out.println(

           num1 + " and " + num2 + " is:");

 

       // Printing the result after operation

       System.out.println(num1 + num2);

   }

}

Similar questions