Quantcast
Channel: S. Nageswara Rao, Corporate Trainer – Way2Java
Browsing all 505 articles
Browse latest View live

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 Article


How 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 Article


Java 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 Article

Can 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 Article

Can 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 Article


New 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 Article

Try 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 Article

Java 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 Article


Java 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 Article


Java 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 Article

Java 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 Article

Java 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 Article

Java 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 Article


Java 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 Article

Java 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 Article


How 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 Article

Java 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 Article


Java 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 Article

JDBC 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 Article

What 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
Browsing all 505 articles
Browse latest View live