aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • architecture Online Quiz - 13
  • What Modifier needs to be added in order to make the belo...
Multiple choice technology architecture

What Modifier needs to be added in order to make the below function as Singleton Class? ----------- -------- Connection getConnection() throws Exception{ return new Connection(); }

  1. private, final.

  2. protected, static

  3. public, static

  4. public, final.

Reveal answer Fill a bubble to check yourself
C Correct answer

Keep practicing — related questions

  • Which of the following cannot be used as a modifier for instance variables while defining a class?
  • A singleton pattern can be achieved by _________________
  • Which two allow the class Thing to be instantiated using new Thing()?
  • Which of the following cannot be used as a method modifier?
  • Given a method in a protected class, what access modifier do you use to restrict access to that method to o...
  • Given a method in a protected class, what access modifier do you use to restrict access to that method to o...
  • 10 What modifiers would be legal at XX in the following code? public class MyClass1 { public static void ma...
  • Need to create a class, which will return the same instance whenever requested
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Object-Oriented Programming (2239 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy