Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

Why should we have a private static Java method?

Asked by Alex Gonzalez Oct 6, 2022 1.1K views 1 answer
Share

About this question

I just wanted to clear up a question I have. What is the point of having a private static method as opposed to a normal method with private visibility?


I would have thought an advantage to having a static method is that it can be called without an instance of a class, but since it's private is there even a point to it being static?

The only reason I can think of is that it helps conceptually understand the method on the class level as opposed to object level.

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.