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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:25:28+00:00 2026-06-08T17:25:28+00:00

I may be wrong as I have not got too much experience with Java,

  • 0

I may be wrong as I have not got too much experience with Java, but here is a question.

I have a class which contains many methods (basically it is a simple library).

I create an object of this class let’s say MyLibrary obj = new MyLibrary(parameters);

The parameters set up any necessary functionality for the library to run correctly.

Then I can call obj.getSomething/obj.setSomething/obj.createSomething etc etc…

In my main class I really need only one this kind of library object.

Now… Would it be more useful for me not to use it as an object, but put it as extends and then create a function inside of the library like a constructor which I would call manually?


EDIT:

The relation between the one class and MyLibrary is very close. Basically, I have many classes which do similar things but have some different higher layer functionality. So I separated method which must be in all those classes.

It seems it is very similar to shape class and triangle, circle, square example. So MyLibrary is similar to shape which contains all the foundation.

  • 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-08T17:25:29+00:00Added an answer on June 8, 2026 at 5:25 pm

    What you described strongly resembles a utility class, similar to Java’s Collections. The class has only static methods, and a private constructor to prevent instantiations. This is a well-known idiomatic pattern in Java – you can use it to create your own groups of methods providing related functionality.

    You should not extend, or even instantiate, utility classes at all. Starting with Java-5, you can statically import them so that you could use their methods without making an explicit reference to their class.

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

Sidebar

Related Questions

I may have have the wrong end of the stick here, but I thought
I may be asking the wrong question here, I'm willing to change it if
I've got an issue with knockoutjs. I may be doing this completly wrong, but
Firstly, Modifying may be the wrong term, I see a few people have posted
I have a text field. If it has wrong values then it may show
I'm new in unit testing so may be I do something wrong. I have
This may be the wrong place but this is new to me. I did
I may be doing something wrong, but I haven't been able to find a
I may be approaching this problem from the wrong angle but what I'm thinking
I may just be doing something wrong but all of my javascript files as

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.