can we update an obj of a class declared in a function from another function without returning it? (in Java)

Viewed 20

Let's say we have a bean class student, we create an object s1 of student in a function called createStudent of some class AddStudentDetails and pass this obj s1 to a void function addMarks in AddStudentDetails. will the changes done in addMarks remains in s1 after the function call of addMarks finishes? kindly tell me w.r.t java.

0 Answers
Related