Browsing tag: java beginner

StringBuilder & StringBuffer

Modifiable Strings by StringBuilder & StringBuffer


In previous blog, we discussed on String and string constant pool.  It highlighted the issue in String manipulation and how it fill the pool memory.  We not recommended to use String for temporary string statement formation, logger statement, updatable string values, large file I/O stream of input processing.  We can process these operation using String

Shallow copy of java objects

Shallow vs Deep Copy of Object by Clone() method


Previous post, we discussed on intention to create copy of object in java. In this post,we would discuss on different implementation of object copying. Before discuss on implementation, let us discuss on basic rule of clone copy implementation. 1) Copy of object and actual object should not refer at same object. If it is same,

doc comment in java

Writing comments in java and Generating document by “javadoc”.


The Java language supports three types of comments in code to explain the business logic in code, to explain the algorithm logic to other developers in code itself or to generate the document content in coding itself. Single line comments : //…………………. Multi line comments : /* ………………. */ Documentation comments /** Document Content */

varargs in java

“varargs” argument in Java Methods


Earlier we discussed on method overloading, it gives same method name and differ by method signature.  If we are not sure about number of argument(but same type) for the method,  we can’t write one method of each combination of argument list.  Code quality recommends maximum 4 overloaded method(with same name) for easy to use and

Constructor in java

Constructors in Java


                A constructor in Java is a block of code similar to a method that’s called when an instance of an object is created. Constructors are used to initialize the object’s state. Like methods, a constructor also contains collection of statements that are executed at time of Object

Methods_In_Java

Methods in Java


Variables are used to store data in java run-time.  Methods are used to process access and manipulate the variables. Methods are primary building block in enterprise application as it holds the business logic of an enterprise. Each object in java talks with other objects by invoking methods. Good programmers write in a modular fashion which