N
N
Nube2016-12-24 14:50:53
Java
Nube, 2016-12-24 14:50:53

Static class or static reference?

I have Class A using methods of class B . In order for the methods of class A to work, I create an object of class B, is it not profitable to create a new object every time a method is called? Would it be better to make class B static or write private static B b = new B() in class A. Is there a difference between these methods?
Question above on java.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question