This is for Java
I am just trying to double check if this is the correct way to create a function for a class and return that type.
//this is inside of the another class or Object2
public Object1 functionName(Object1 variable1) {
//Do I even need to do this below? Cause I am passing it in as a parameter
Object1 variable = new Oject1();
//code in here
return variable1; //returning Object1 variable1
}
I am just trying to double check if this is the correct way to create a function for a class and return that type.
//this is inside of the another class or Object2
public Object1 functionName(Object1 variable1) {
//Do I even need to do this below? Cause I am passing it in as a parameter
Object1 variable = new Oject1();
//code in here
return variable1; //returning Object1 variable1
}