Core Java - Interview Questions and Answers for 'Util classes' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Util classes' - 2 question(s) found - Order By Newest

 Q1. In which cases , moving methods to utility class could be useful ?Core Java

Ans. It could be worthy to move a method to util class if the method needs to be shared, doesn't require polymorphic behavior and need not be overridden in special cases.

Don't belong to one group through is-a relationship ( You can share through parent class method )

Don't implement a specific interface ( java 8 default methods )

Doesn't involve complex computing as you will be loosing the benefit of object state with just static method.

Doesn't require polymorphic behavior as static methods don't participate in runtime polymorphism.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     utility classes   util classes   static methods   application design        rare


Related Questions

  Name few Java util classes that were introduced with Java 7 ?
  Name few Java Util classes introduced with Java 8 ?
 What are Util Classes ? What are its advantages ?


 Q2. What are Util Classes ? What are its advantages ?Core Java2017-03-10 10:48:48

Ans. Classes having only static methods in java is called util classes. As they don't have specific object state, they are basically intend to have shared code and state through static elements and methods. They save resources by sharing code.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     util classes

Try 1 Question(s) Test


Related Questions

 In which cases , moving methods to utility class could be useful ?
  Name few Java util classes that were introduced with Java 7 ?
  Name few Java Util classes introduced with Java 8 ?


 Q3. An Ideal Util class doesn't have ...Core Java
a. private constructor
b. static methods
c. static variables
d. non static methods

Ans.d. non static methods


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: