public class Test {
public String xyz(){
String name="stack";
return name;
}
public static void main(String[] args) {
Test t=new Test();
t.xyz(); //this should stack isn't it??
}
}
Run Code Online (Sandbox Code Playgroud) java ×1