How to use a Java Constructor?
In Java, a class comprises of instance (global) variables, constructors, methods and objects (excluding static blocks and inner classes). These are known as constructs of a class. It’s being a...
View ArticleHow to increase speed of execution (Performance) in Java?
Any software product developed should have three features. 1. Should execute on less RAM 2. Should have high performance 3. Should be user friendly Performance of a program execution is very important,...
View ArticleJava Encapsulation, Abstraction, Data hiding and Data binding
In an object-oriented programming language, like Java, Encapsulation, Abstraction, Data hiding and Data binding are very confusing words, everyone feels confused to understand. Many Web sites discuss...
View ArticleCan we instantiate an abstract class?
Put the same question for an interface. Everyone says anonymously, "no" because there is no implementation (body) of methods as all are abstract. Coming to an abstract class, the question arises as one...
View ArticleCan you create instance of Interface?
No, it is not possible. Designers did not provide a way. Of course, it is of common sense also. Because interface contains only abstract methods and as abstract methods do not have a body (of...
View ArticleNew Switch with String support – Java 7 Features
Every version of Java brings some new features to make Java coding simple to practice. JDK 1.7 brought many features and one among is switch statement. Switch is a control structure existing in all...
View ArticleTry with Resources Example in Java 7
Every version of Java adds some new features and the latest version JDK 1.7 (as on August, 2013) comes with new additions. Following are the new additions. 1. String in Switch Expression 2. Underscores...
View ArticleJava Generating Random Numbers
Many a times random number generation is required in coding, especially in testing. When different sequence of numbers are passed multiple times, a correct result should to be obtained; testing...
View ArticleJava Stack Tutorial
The Data structure purpose is to store data temporarily. Here temporarily means the data stored is available as long program executes and once program is terminated the data is lost. If started again,...
View ArticleJava Vector Tutorial
Vector is like an array but with a small difference – array stores similar data types and cannot grow in size were as vector stores dissimilar types and can grow the size as needed at runtime....
View ArticleJava Hashtable Tutorial
Hashtable is a DS with a different style storing the elements. Hashtable takes key, value parameters. That is, to store a value, a key should be supplied. This key is used to retrieve the value later....
View ArticleJava Properties Tutorial
Properties is one more DS of Java very similar to Hashtable representing each element as a key/value pair. Properties differs very slightly with Hashtable. Hashtable key and value can be objects of any...
View ArticleJava ArrayList Tutorial
ArrayList is very similar to Vector but for synchronized methods. Vector comes with synchronized (thread-safe) methods but ArrayList not. Internally, ArrayList stores elements in the form of an array....
View ArticleJava Linked List Tutorial
LinkedList class is derived from List interface. Being a subclass, it can make use of all the methods of List especially like listIterator() etc and includes the general common methods (derived from...
View ArticleJava Queue Example
Queue was introduced in JDK 1.5 version and is part of Collections framework, but Stack was there from JDK 1.0 version. Queue does not permit random access of elements, that is we cannot place or...
View ArticleHow to use Enumeration in Java?
Java comes with innumerable data structures like Stack, Vector, Hashtable, Properties, ArrayList, LinkedList, HashSet, TreeSet, HashMap etc. each one serving a specific purpose. But all are easy due to...
View ArticleJava HashSet
It is the implementation of Set interface. Being derived from Set, this data structure does not accept duplicate elements. This class allows null element, that too only once (as no duplicates). Return...
View ArticleJava Map Interface
The Map interface stores the elements in key/value pairs (as in Hashtable). It does not accept duplicate keys. One key represents only one value. Two keys may have the same value. For example, two...
View ArticleJDBC Tutorial
Before going into the definition, let us see some scenario. Suppose you go to a Bank ATM center (I call it as a ATM client) to know your account balance. You insert the card, type the pin number, click...
View ArticleWhat is Driver and JDBC Driver Types
After knowing what is JDBC in JDBC tutorial, let us know drivers as they are required in each JDBC programming. What is a driver? Driver is a software which connects two dissimilar software components...
View Article