Core Java
How many types of java comments are there? Everybody knows there are two types of java comments available. Now the misunderstood part starts. What are those two types of java comments?
The (§3.7) Java Language Specification Third Edition says,
Traditional Comment
End of line Comment
What happened to the documentation comment or javadoc comment?
No it is not a type [...]
This check list for Internationalization (I18n) will cater to the need of programmers irrespective of the language java /dot net/ j2ee / any other.
Translatable items
GUI – Labels and Menu items
User messages including third party component generated
Log / system generated messages
Help – Online help / manual and other deliverable documentation
Installation notes [...]
In java, a frequent occurence of a common phenomenon related to memory management is creation and destruction of temporary objects. What are java temporary objects? For example in java, when two strings are concatenated, a StringBuffer object is created. As two Java String objects cannot be added directly (immutable property), a helper object StringBuffer is [...]
First lets understand what does “java import” does to your java program!
Consider the java import statements:
1) import package.ClassA;
2) import package.*;
Java statement (1) gives you a license to use ClassA inside the whole program without the package reference. That is you can use like ClassA obj = new ClassA(); or ClassA.getStatic(); Java statement (2) allows you [...]
java.util.Vector came along with the first version of java development kit (JDK). java.util.ArrayList was introduced in java version1.2, as part of java collections framework. As per java API, in Java 2 platform v1.2,vector has been retrofitted to implement List and vector also became a part of java collection framework.
All the methods of Vector is synchronized. [...]
Java variables can be categorized into the following seven types:
Class Variable
Instance Variable
Array Component Variable
Method Parameter Variable
Constructor Parameter Variable
Exception Handler Parameter Variable
Local Variable
1) Class Variable
A java class variable is a field declared using the keyword static within a java class, or with or without the keyword static within a java interface declaration.
2) Instance Variable
Java variables that [...]
Following answer is applicable irrespective of the language and platform used. Before we enter into session tracking, following things should be understood.
What is a session?
A session is a conversion between the server and a client. A conversion consists series of continuous request and response.
Why should a session be maintained?
When there is a series of continuous [...]
Java marker interface has no members in it. Marker interface ‘was’ used as a tag to inform a message to the java compiler.
Java Marker Interface Examples:
java.lang.Cloneable
java.io.Serializable
java.util.EventListener
Lets take the java.io.Serializable marker interface. It doesnot has any members defined it it. When a java class is to be serialized, you should intimate the java compiler in some way [...]
A java variable can be declared using the keyword final. Then the final variable can be assigned only once.
A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialise it.
Java classes declared as final cannot be extended. Restricting inheritance!
Methods declared as [...]
Access modifiers specifies who can access them. There are four access modifiers used in java. They are public, private, protected, no modifer (declaring without an access modifer). Using ‘no modifier’ is also sometimes referred as ‘package-private’ or ‘default’ or ‘friendly’ access. Usage of these access modifiers is restricted to two levels. The two levels are [...]