Archive for June, 2008
Initialization Blocks in Java
Apart from methods and constructors, Initialization Blocks are the third place in a Java Program where operations can be performed. Initialization Blocks come in two flavours:
Static Initialization Blocks: Runs first when the class is first loaded. Declared by using the keyword “Static”
Instance Initialization Blocks: Runs every time when the instance of the class is created.
Java vs.NET – Articles by Bruce Eckel
There are two articles by Bruce Eckel in which he has spoken in brief about C# / .NET and Java. These two are pretty old articles but i feel they are worth reading once, pretty small write ups. Bruce Eckel is the author of famous Thinking in sreis- Thinking in C++ and Thinking in Java.
Article 1- [...]
C Programming VS. Java Programming
I wanted to know how C and Java differ from each other. So i just googled for “C Versus Java” . The first Link itself led me to an interesting Description. I thought of sharing it with my readers. Pretty good Comparision of C and Java. One can read the comparision here.
PS: If anyone has [...]
Shadowing Variables in Java Demystified
One of the meanings of the word “Shadow” in the Oxford Dictionary is “a weak or less good version”. Shadowing in Java is also something similar. One can shadow a variable in several ways. I would try to describe the one most comman ways which would trip most of us i.e. “Hiding an instance variable [...]
Read Full Post | Make a Comment ( 3 so far )Cohesion and Coupling: Two OO Design Principles
Cohesion and Coupling deal with the quality of an OO design. Generally, good OO design calls for loose coupling and high cohesion. The goals of OO designs are to make the application
Easy to Create
Easy to Maintain
Easy to Enhance
Coupling:
Coupling is the degree to which one class knows about another class. Let us consider two classes class [...]
CamelCase Notation- Naming Convention for Programming Languages
CamelCase is the practice of writing compound words or phrases in which the words are joined without spaces and are capitalized within the compound like BreakFast, myName etc. CamelCase is so named because each word in the identifier is put together without spaces, but with the first letter of each word captilised, looking like humps [...]
Read Full Post | Make a Comment ( None so far )Static Members: Static Methods and Static Variables
Why do we need Static members?
There are situations in which the method’s behaviour does not depend on the state of an object. So, there will be no use of having an object when the method itself will not be instance specific.
Let us consider another situation where in we want to keep a count of all [...]
Java SE Update 10 Beta Available
Java SE 6 Update 10 Beta is an update release that introduces new features and enhancements aimed at providing an optimized consumer-end user experience. It is available for download as part of Java SE Early Access Downloads. Java SE 6 update 10 focuses on the following areas:
Enhanced JRE Installation experience
Improved performance and look [...]
Casting Reference Variables- Downcasting, Upcasting
Let us consider two classes class Animal, a more generic class and class Cat, a more specific class i.e a more specific animal. Let us settle for simple definitions for both the classes so as to get the concept right.
/*
The definition for more generic class Animal
Notice the eat() method, which will be inherited by all [...]
Top Ten Errors Java Programmers Make
I read an article on “Top Ten Errors Java Programmers Make“. The author has mentioned the errors which even the most programmers often commit or the New to Java programmers may commit in the future. Not only has he listed the errors but also given the possible solution for the same. I found the article [...]
Read Full Post | Make a Comment ( None so far )« Previous Entries
