Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6195153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:25:08+00:00 2026-05-24T03:25:08+00:00

I just watched a youtube tutorial called many methods and instances. He made a

  • 0

I just watched a youtube tutorial called “many methods and instances”. He made a program in which you enter something and it says “your first gf was _“. But it was way too overcomplicated. First is the main class:

import java.util.Scanner;

public class MethodsInstances2 {
    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        MethodsInstances object = new MethodsInstances();
        System.out.println("Enter name of first gf here: ");
        String temp = input.nextLine();
        object.setName(temp);
        object.saying();
    }
}

Next is the class it makes an object from:

public class MethodsInstances {
    private String girlName;
    public void setName (String name){
        girlName=name;
    }
    public String getName (){
        return girlName;
    }
    public void saying(){
        System.out.printf("Your first gf was %s", getName());
    }
}

It seemed WAY too overcomplicated, and the title is all of the stuff i didn’t understand, considering I’m still a newbie at Java. Here’s what I typed which took 4 times faster:

import java.util.Scanner;
public class programtest {
    public static void main(String args[]){
        Scanner test = new Scanner(System.in);
        String name;
        System.out.println("Enter the name of your first girfriend: ");
        name = test.next();
        System.out.println("Your first girlfriend was " + name);
    }
}

Can someone tell me the point of doing what the tut said to do, and what the title words mean?

Thanks a lot, Dan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:25:09+00:00Added an answer on May 24, 2026 at 3:25 am

    The tutorial is named “many methods and instances” and from my POV shows very simply how to create a class, instantiate it and call its methods. It would have been called “get some console input and spit it back out” if it was meant to do things the easiest way possible.

    The point of the video tutorial was not to create an overly complicated program but rather to demonstrate how to call methods on objects.

    You have a class called MethodInstances (not a great example name, btw) which you instantiate and then call methods on it to save state (gf name) and the get it back and display it. (I would suggest refactoring the example to have it make more sense. The verbiage as it is causes confusion.)

    Try this on:

    import java.util.Scanner;
    
    public class ObjectInstanceMethodExample {
        public static void main(String args[]) {
            Scanner input = new Scanner(System.in);
            FirstGirlfriend firstGF = new FirstGirlfriend();
            System.out.println("Enter name of first gf here: ");
            String temp = input.nextLine();
            firstGF.setName(temp);
            firstGF.sayFirstGirlfriendName();
        }
    }
    
    class FirstGirlfriend {
        private String girlName;
        public void setName (String name){
            girlName=name;
        }
        public String getName (){
            return girlName;
        }
        public void sayFirstGirlfriendName(){
            System.out.printf("Your first gf was %s", getName());
        }
    }
    

    You short circuited the process by avoiding creating a separate class and using a local variable instead. It works, it’s easier, but that’s not what the tutorial was trying to teach.

    I suggest finding even simpler examples for starters before getting into OOP stuff or… embracing OOP and running with it.

    Btw, you will not progress as a programmer by always doing things the easiest way. Easiest only seems easiest in the near term. Any less-than-trivial project with even a bit of complexity will quickly become untenable by doing it the easiest way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just watched this funny YouTube Video about unit testing (it's Hitler with fake
I just watched the Windows Azure intro video and it left me feeling like
I just watched the last Channel 9 vid on the upcoming parallel extensions to
I'm just learning Ruby on Rails. I've read a few books, I've watched lots
Just what the title says, I need to change the password for an existing
I just watched a video of Douglas Crockford's presentation about his 2009 book JavaScript:
I've watched this video from Google I/O 2009: http://www.youtube.com/watch?v=AgaL6NGpkB8 where Brett shows microblogging example.
I just watched Google Wave Keynote video on Google I/O and I must say
I just watched a video about unit testing WebOS applications and they used the
I just watched a video regarding the Report Designer. It said to go to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.