How do I figure out what class called my method without passing any variable to that method? let's say we have something like this:
Class A{}
Class B{}
Class C{
public void method1{}
System.out.print("Class A or B called me");
}
let's say an instance of Class A calls an instance of class C and the same for class B. When class A calls class C method1 method, I want it to print something like "Class A called me", and when class B called it to print "Class B called me".