skip to main | skip to sidebar

T

private constructor

Private constructor is used if you do not want other classes to instantiate the object. The instantiation is done by a public static method within the same class.
Used in the singleton pattern. (Refer Q45 in Java section).
Used in the factory method pattern (Refer Q46 in Java section).
Used in utility classes e.g. StringUtils etc.
Newer Post Older Post Home

About Me

lucyjava
View my complete profile

Blog Archive

  • ▼  2007 (106)
    • ►  September (19)
    • ►  July (42)
    • ▼  June (45)
      • case-insensitive string sort
      • SAX vs DOM
      • Singleton
      • Threads block on I/O
      • 2 synchronized methods in one object
      • Thread communication
      • daemon thread
      • synchronization level
      • thread, lock, monitor
      • yield vs sleep (thread)
      • Thread states
      • Creation of thread
      • Process/Thread
      • throw/throws
      • Best Practice for exception handling
      • Exception
      • PreparedStatement
      • Try-Catch-Finally
      • Joins: Innter, Outer,Equi, Natural..
      • garbage collector
      • type casting
      • Nested Classes
      • Inner classes
      • re-entrant, recursive and idempotent
      • stack and heap memory
      • final/finally/finalize()
      • final modifier
      • private constructor
      • static method
      • Static/Instance Variable
      • Java Object methods
      • shallow/deep clone
      • Improve IO performance
      • NIO
      • Java IO stream
      • Serialization
      • pass-by-reference vs pass-by-value
      • String vs StringBuffer/StringBuilder
      • Methods to override for HashMap key
      • Initial Capacity & Load Factor
      • Best Practices for Collections
      • Collection Framework
      • ArrayList, Vector, LinkedList
      • Overload
      • Override