Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
40 views1 page

Java

This Java code defines two methods, method1 and method2. Method1 declares three integer variables, sets c equal to the sum of a and b, and prints the answer. Method2 declares three integer variables, sets c equal to the product of a and b, and prints the result.

Uploaded by

Nainil Tripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

Java

This Java code defines two methods, method1 and method2. Method1 declares three integer variables, sets c equal to the sum of a and b, and prints the answer. Method2 declares three integer variables, sets c equal to the product of a and b, and prints the result.

Uploaded by

Nainil Tripathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

void method1()

{
int a= 1;
int b= 2;
int c= a+b;
system.out.println("The answer is: "+c);
}

void method2()
{
int a = 2;
int b = 3;
int c= a*b;
system.out.println("The result is: "+c);
}

You might also like