Skip to main content
Post Closed as "Duplicate" by Makoto, Nir Alfasi java
added 2 characters in body; edited title
Source Link
Muhammad Soliman
  • 24k
  • 6
  • 115
  • 81

objects - calling object instance in anotherinside a static method

public class create{ public static void main(String[] args){ Student myStudent = new Student(); ... } public static String makeStudent() { student.set(x); student.get(x); }} public Student{ ... } 

Is it possible to call an object instance in a static method when the instance was created in the main method?

objects - calling object instance in another method

public class create{ public static void main(String[] args){ Student myStudent = new Student(); ... } public static String makeStudent { student.set(x); student.get(x); }} public Student{ ... } 

Is it possible to call an object instance in a static method when the instance was created in the main method?

objects - calling object instance inside a static method

public class create{ public static void main(String[] args){ Student myStudent = new Student(); ... } public static String makeStudent() { student.set(x); student.get(x); }} public Student{ ... } 

Is it possible to call an object instance in a static method when the instance was created in the main method?

Source Link

objects - calling object instance in another method

public class create{ public static void main(String[] args){ Student myStudent = new Student(); ... } public static String makeStudent { student.set(x); student.get(x); }} public Student{ ... } 

Is it possible to call an object instance in a static method when the instance was created in the main method?