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 3988556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:15:59+00:00 2026-05-20T06:15:59+00:00

I know what all of these do except for abstract. I’m currently in the

  • 0

I know what all of these do except for abstract. I’m currently in the process of teaching myself java with what I consider a middle-school-level education (my highschool was in a bad neighborhood so I got shafted)…

But what exactly are the usage patterns for these keywords? When do I use what? When do I omit them? Putting ‘public’ in front of my classes makes every class that uses it require a new file, can I just omit that if I want to create a monolithic source file?

Every bit of information I look up, explains exactly WHAT these do, just doesn’t give a clear view of when/why/where I should use them.

Thanks in advance,
Anthony

  • 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-20T06:16:00+00:00Added an answer on May 20, 2026 at 6:16 am

    For beginners, here are my rules of thumb:

    1. Public: all classes should be public (this isn’t quite true, but it’s pretty close). For methods, think about your TV set: stuff you’d expect to do to your TV is “public”.
    2. Private: implementation details should be private. Think about your TV set: functionality is private if the equivalent kind of thing for a TV should be private, because the user can mess the TV up permanently, get electrocuted, etc.
    3. Protected: ignore this for now.
    4. Abstract: The best example I read when learning Java was to think about “Bird”. Bird is abstact, and therefore would have an “abstract” flight method. Individual species of bird know how to fly (unless they’re penguins – then they throw UnsupportedOperationException).

    I would strongly suggest you fight the urge to use one monolithic source file. Try to keep methods shorter than one screenful, and classes shorter than 300 lines.

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

Sidebar

Related Questions

I'd like to write a basic socket chat app, except encrypted. Y'know all those
Anybody know how to get all of these in a C# app that leads
There seems to be too many attributes/parameters in CSS... I want to know all
Here comes a simple question, for all those who know javascript. I made an
We all know that most applications out there assume class names to follow the
I know that technically all three ways below are valid, but is there any
All I want to know is if there's an easy way to add lines
First of all: I do know that there are already many questions and answers
I know that there are lot's of questons on this, but all seem to
I want to know if there's any way to update from all versions (Example:

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.