Archive | CoreJava

Final Keyword in java

Jun 22nd, 2011No Comments

Final

    Final is keyword in java

Final With Variable

    Final Variable can be declared either block level or instance level
    Final Variable can be initialized only once. Re-initialization causes a compile time error

Final Method

    Final Methods behaves like constants these methods are not allowed to override in child classes
    Final Methods won’t participate with abstract,private Keywords

Final Class

    Final Class behaves like constant
    Final Class can’t act as a base class in inheritace
VN:F [1.9.10_1130]
Rating: 9.8/10 (5 votes cast)
VN:F [1.9.10_1130]
Rating: +5 (from 5 votes)

Difference between String/String Buffer/String Builder

Jun 22nd, 20114 Comments

String

    Immutable Object
    It contains non-synchronized methods

String Buffer

    Mutable Object
    It contains synchronized methods

String Builder(from 1.5)

    Mutable Object
    It contains non-synchronized methods
VN:F [1.9.10_1130]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.10_1130]
Rating: +4 (from 4 votes)

jdbc

May 13th, 2011No Comments

step 1: Get the Connection object.

step 2: Get the Statement object.

step 3: Bind the parameters to SQL query.

step 4: Execute the SQL query.

step 5: Process the result.

step 6: Close the connections and take care of exceptions.
(more…)

VN:F [1.9.10_1130]
Rating: 9.0/10 (3 votes cast)
VN:F [1.9.10_1130]
Rating: +5 (from 5 votes)