- For classes, public means any class can use that variable. Private means only the method can use that variable.
- Private means private inside this class; no other class can get to it.
Whatever your method does, it may or may not return something. This method:
public String getname()
is going to return a string. Thus the String. But if your method returns nothing, then you type void instead.
Here, there is a special command printf. It outputs “Your first gf was” and what is inside getName.
What is happening is that a new Scanner called “input” is made. There is another class called tuna, so to call it we gave it the name “tuna Object”. New objects that are made are to the left; that’s why new is the right, telling java to make a new Scanner or new tuna.