About Me

My photo
"Enoughtheory.com" had its humble beginning in the year 2011 by ( Founder of Enoughtheory.com ) Mr Ravi Kant Soni , an Enterprise Java and Spring Framework Specialist, with a bachelor degree (B.E) in Information Science and Engineering from Reva Institute of Technology at Bangalore. He has been into the software development discipline for many years now. Ravi has worn many hats throughout his tenure, ranging from software development, designing multi-tenant applications, integration of new technology into an existing system, to his current love of writing a Spring Framework book. Currently, he is a lead engineer at HCL Technology. Ravi has focused on Web and Enterprise development using Spring Framework for most of his career and has been extensively involved in application design and implementation. He has developed applications for Core-Bank, HR and Payroll System, and e-Commerce systems using Spring Framework. Ravi Kant Soni is author of book "Learning Spring Application development" http://learningspringapplicationdevelopment.com

Monday 2 September 2013

Just Java

  • Why use Inner class
    • The use is to increase encapsulation and hide some implementation details. Classes like Semaphore use internal objects for locking, etc.
  • Serialization
    • Serialization purpose is not persistence, there are DB's for that. Use of serialization is to transfer objects over network. We can write the Java object as byte array in memory, and later again construct the object from byte array in memory.
  • ConcurrentModificationException
    • arraylist is getting modified by other thread
  • Ensure that instance is never garbage collected
    • static reference to a singleton, so it won't be eligible for garbage collection until the classloader is eligible for garbage collection
  • Java Runtime Memory Management
    • MemoryManagement is Garbage Collection and memory allocation
  • Local Variables are thread safe, local variables can be used to confine objects to a thread
  • Immutable objects are always thread safe. A properly consturcted(this doesn't escapes), and state can't be modified, and may be all fields are final. No requirement for safe publication.