meaning of return value in java?
===

i am a beginner and i was watching a tutorial on youtube where the tutor talked about various methods. he talked about returning values in java but i didn't understand a thing about it. i will first share the script and then share my thoughts and queries.

here is the class1 script:

    import java.util.Scanner;
    class class1{
	public static void main(String args[]){
		System.out.println("This is class1.");
		Scanner x = new Scanner(System.in);
		System.out.print("Please enter the name of your first gf here:");
		String name = x.nextLine();
		
		class2 class2obj = new class2();
		class2obj.setname(name);
		class2obj.tellname();
	}
    }

as you can see it is having the main method and what it does is first ask for the name of your first girlfriend and then store it in the variable `name`. then it links the class2 script which i will share after this and executes the setname method in the class2.

the `class2` script is:

    class class2{
    	private String girlname;
    	public void setname(String name){
		girlname = name;
	}
	public String returnname(){
		return girlname;
	}
	public void tellname(){
		System.out.printf("your first girlfriend was %s",returnname());
	}
    }

in the `class2`, i can see that the `setname` method sets the value of the `name` to a private variable `girlname` but my question is that what is return? why do we require the `returnname` method? is it absolutely essential for inter-method variables? also, why isn't it posible to return the `girlname` in the `setname` method?

i dont know a thing about the return, so a video or an article would help a lot. also, this is the reason if you find what i say above strange.

also, please tell me what the `returnname` method and the `tellname` method is doing.

also, in `class1` we executed `class2obj.tellname` why didn't we execute `class2obj.returnname` ?

i am really confused right now so please dont mind if i am acting like i have iq of a horse.

thanks a ton! 