return method java
int a = 20;
int b = 20;
public static int sum(){
return a + b;
} // Return Function
public static void sum(){
System.out.println(a + b);
} // Void Method. it Prints and does not return anything
return method java
int a = 20;
int b = 20;
public static int sum(){
return a + b;
} // Return Function
public static void sum(){
System.out.println(a + b);
} // Void Method. it Prints and does not return anything
how to create a function that returns in java
// a method for computing the area of the rectangle
public int getArea() {
return width * height;
}
return statement in java
A return statement causes the program control to transfer back to the caller of a method.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us