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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:07:25+00:00 2026-05-18T22:07:25+00:00

I am developing an application in Java, which manages a database of bank’s loans.

  • 0

I am developing an application in Java, which manages a database of bank’s loans.
I have some expierience in application developing and I have a question that might be silly but it is something I always talk about since I’ve been learning developing languages and never got a conviencing answer.

In my program I have many classes and methods, which I use as generic tools. For example, I have a class for Excel writing, a class for file reading/writing, a class which manipulates strings in various ways, a class to show Dialogs/Messages in a default format of mine, a class for specific mathematical functions (like Math), etc.

I cannot imagine those classes as real things (like classes/objects are meant to), but they come to my mind as toolboxes. That is why I make them static. In that way I write for example

excelWriter.create("C:\temp.xls");
excelWriter.append("mydata1\tmydata2\nmydata3\tmydata4");
excelWriter.close();

rather than

ExcelWriter myExcelWriter;
myExcelWriter.create("C:\temp.xls");
myExcelWriter.append("mydata1\tmydata2\nmydata3\tmydata4");
myExcelWriter.close();

This suits me better for the reason that I think of a toolbox like something that is always there for me and I don’t need to create an object everytime I want to use it. Isn’t C++’s Math the same case and static also?
I have discussed it with many of my colleagues and coding-friends and most of them say that I have to create an object because that’s what object oriented programming is all about.

I understand what they said in another context:
In my spare time I’ve been developing a card game using VB.net. There I had classes for game, player, deck, hand. The objects I made where many out of every class, because I have many games, players, decks, hands. And they can be imagined as real things. It is specifically very different when you are developing a game. The developing of a game is much more object oriented because it contains real things.

I was wondering, am I somehow terribly wrong here?
I would like to hear oppinions about what oop is all about in depth.
I would also like to hear what static classes are for.

Thanks

  • 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-18T22:07:26+00:00Added an answer on May 18, 2026 at 10:07 pm

    No, a class containing only static member functions would not be the right thing in this case, at least in my opinion. The second ExcelWriter class would be better. Anyway, where are you storing the file handle for your Excel output? Not in a static variable, I hope? That is a prime candidate for a data member for this class.

    Try to think, in this case, of the object as representing the output stream that you are writing to. In the future, you might want to open two output streams at the same time, which would not be possible with your “toolbox” class.

    Sometimes, classes containing only static member functions can be useful as a way of grouping related functions, but this is rare and often means the class can be redesigned around an object containing data. Static member functions can be useful as a way to have different constructors for a class, for example.

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

Sidebar

Related Questions

My team is developing a large java application which extensively queries a MySQL database
I'm developing a java servlet web application that manages information from multiple databases (all
I am using netbeans for developing java dextop application,I have created a JFilechooser which
I'm developing Java MIDI application. And I have stuck with debugging of exception, which
I'm developing a Java application using Eclipse. My project has two source directories that
I am developing a Java desktop application and would like to have an external
I am developing a Java based desktop application. There are some data generated from
I am developing a Data Modeling Software that is implemented in Java. This application
Hai I am developing a standalone application using Java in which I am using
I have built a multi-touch application which is based on a Java EE backend

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.