I have declared a method in a class named Teacher used return statement,
public String info(){
return "Name is " +name +"Location is "+location;
Then I built the constructor then I called it from main class
Teacher t1= new Teacher("Tim","Guildford","Reader");
t1.info();
However both in cmd windows and intellij , there is no result.
But if I change the method type to void and use system.out.println, every thing is fine.
What is the problem here?