A class inheriting the method from its superclass has the option to override it. The benefit of overriding is the ability to define behavior specific to a particular class. In the case of a concrete subclass, it is forced to implement all methods defined in abstract class if no other superclass implemented it in the hierarchy. Overriding sometimes referred… Continue reading
Exception in Java is used to handle errors or any other exceptional event that occurs in the normal flow of a program. There are several way Exception can occur in Java. Data provided is not in expected format(eg. int instead of String). DB cannot be connected. Network connection Lost. An object is null. …..
Collection Framework has been added in JDK 1.2 and has been expanded in 1.4 -1.6 Interface & Classes of Collection Framework Collection API provides a group of the interface to choose from, but it also gives you some concrete classes to directly play with. Core Interfaces Collection List Set SortedSet (Extends Set Interface) NavigableSet (Extends SortedSet) Map… Continue reading
Defining a Contract means to create an Interface. This Contract states what a Class can do without forcing how it should do it. In this Java Interface Tutorial, we will talk about Interfaces. How to create one and rules applied to Interfaces.
Let’s learn more about local variables in Java. Variables that are declared inside Methods in a Java program are called local variables.
An Instance variable in Java is used by Objects to store their states. Variables that are defined without the STATIC keyword and are Outside any method declaration are Object-specific and are known as instance variables. They are called so because their values are instance-specific and are not shared among instances. If a class has an instance variable,… Continue reading
Reference variables are used to refer to an object. They are declared with a specific type that cannot be changed. Types of reference variables Static Variable Instance Variable Method Parameter Local Variable
A string is one of those Object which is used heavily in Java. And this is the reason why String has unique handling in Java(String Pool).
What is Static Static is a Non Access Modifier. Applicable to The Static keyword can be applied to Method Variable Class nested within another Class Initialization Block
Java Array is a data structure type which is used to store multiple variables of the same type. Arrays can hold Primitives as well as Object. The variables in the array are ordered but not sorted. Each element in the array have an index and starting index for element in array is 0. An array… Continue reading