Blog

Java Encapsulation

Encapsulation is one of the key concepts of Object Oriented programming which has benefits such as flexibility and maintainability. It is defined as hiding the fields of an object without getting updated or misused. Encapsulation: Encapsulation is done when the instance variables are marked with the ‘private’ access modifier. Then, having getters and setters (methods)…

Read More →

Java Abstraction

Abstraction in OOP is where creating interface or abstract classes to define the common behavior and reuse or implement it by extending it. In Java, Abstraction works with a keyword called Abstract. Abstract Class: A class declared with a keyword ‘abstract’ is said to be Abstract class. This abstract classes cannot be instantiated. It can be…

Read More →

Java Polymorphism

Polymorphism means many forms and it is one of the key concepts of Object oriented programming in java. As you all know, in the Inheritance section we have discussed that the sub classes have their own unique features and also shares some of the common features in their parent class. Sub classes do override some…

Read More →

Java Overriding

Overriding is one of the important concept in Polymorphism. In Inheritance, say if a sub class has different implementation of one of the certain method in the parent class, then it needs to be overrided in the sub class. Overriding: The overriding method in the subclass should have same name, number and type of parameters…

Read More →

Java Inheritance

Now its time for us to get into Java Object Oriented Programming concepts (OOP). Inheritance is defined as defining the common features (eg. variables & methods) in a single class and reusing them by using the sub objects. Sub objects means the sub classes which inherits the common feature class. Inheritance: Parent Class – The…

Read More →

Java Exceptions

Sometimes the program may fail at a particular line due to invalid input, or invoking another application’s method which is down will lead to blow up the entire program. If we know these statements are risky in nature then, we need to handle it. This process is said to Exception Handling. Exception Handling: By default,…

Read More →

Java Arrays & Enum

An array is used in java to hold multiple items of a particular datatype. Each item in it is a variable of same datatype which holds value. There will be a place where we might be needing many variables to hold different values and it will become a tedious process to use everything in the…

Read More →

Java Loops & Conditions

There are basically two types of Control Structures. They are the Decision Control structures and Repetition Control structures. These structures determines the order in which the statements in the program are executed. Decision Control structures: These structures executes a specific block of code if the given condition is true. There are three different types of decision control…

Read More →

Java Operators

Operators are used in java along with the variables to achieve arithmetic, logical, conditional & relational functionalities. There are different types of operators available as below. Types of Operators: Assignment Operator Arithmetic Operators Relational Operators Conditional Operators Unary Operators Type Comparison Operator Bitwise Operators Equality Operator   Assignment Operator: (=) It is used to assign any…

Read More →

Java Modifiers

Modifiers are the keywords that are used in java for definition of variables, classes or methods. What are the access modifiers? public, protected and private are the three access modifiers used in Java. public – Can be accessed anywhere in classes from same package or in other packages. private – Can be accessed only within the same class. protected – Can…

Read More →

Back to Top