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

  • SEARCH
  • Home
  • 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 9015045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:39:15+00:00 2026-06-16T03:39:15+00:00

I was helping a friend on his Java homework today, and I guess I

  • 0

I was helping a friend on his Java homework today, and I guess I didn’t realize there being a difference between plain Java and Java in Android. Quick write up of the program:

public class myClass{

    public static void Main (String[] args){
        doThis();
    }

    public void doThis(){
        System.out.println("Did this");
    }
}

But when running that, I got a complaint that I needed to make the doThis() method to be static. Why is that? When I develop some basic things in Android, I never have to use the static keyword.

Note: This could stem from the fact that I’m intimidated by what static actually means.

  • 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-06-16T03:39:16+00:00Added an answer on June 16, 2026 at 3:39 am

    Why is that?

    Because Main() is static.

    If Main() was an instance method, and you had called Main() on an instance of myClass (e.g., new myClass), then doThis() could also be an instance method. Or, if your static Main() created an instance of myClass, it could call doThis() on that instance.

    When I develop some basic things in Android, I never have to use the static keyword.

    That is because your entry points in Android tend to be instance methods on components (e.g., onCreate() of an Activity.

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

Sidebar

Related Questions

I am helping a friend with his C# homework, but is being a long
I am helping a friend from first year to prepare his exam on Java.
Helping a friend with his new tumblr blog. Anyway I preface this with that
Today I was helping a friend of mine with some C code, and I've
I'm helping a friend with a java problem. However, we've hit a snag. We're
I am helping a friend with his course work. Basically the project requirement is
I was helping a friend with some C++ homework. I warned said friend that
So today a friend is helping me with a PHP project I am making.
helping my friend with his old ASP site and ran into an issue so
While helping a friend with a git problem today, I had to introduce a

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.