JAVA ABSTRACTION

The major use of abstract classes and methods is to achieve abstraction in Java. Abstraction is an important concept of object-oriented programming that allows us to hide unnecessary details and only show the needed information. This allows us to manage complexity by omitting or hiding details with a simpler, higher-level idea. A practical example ofContinue reading “JAVA ABSTRACTION”

DYNAMIC BINDING

“Dynamic” means “run time” and “binding” means “association”.  Method Overriding is a perfect example of dynamic binding as in overriding both parent and child classes have same method and in this case the type of the object determines which method is to be executed. The type of object is determined at the run time so this is known as dynamicContinue reading “DYNAMIC BINDING”

Types of Inheritance In Java

Types of inheritance: On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical. Single Inheritance: When a class inherits another class, it is known as a single inheritance. Sample Program: CLASS A PROGRAM: package x.ab;public class A{public static void main(String[]args){}public void methodA(){System.out.println(“Base Class Method”); }} CLASS B PROGRAM:Continue reading “Types of Inheritance In Java”

Java Access Modifiers/Specifiers :

An access modifier restricts the access of a class, constructor, data member and method in another class. In java we have four access modifiers:1. Default2. Private3. Protected4. Public Default Access Modifier: Default Access Modifier is otherwise called as Package Level Access Modifier. If you don’t use any modifier, it is treated as default by default. The defaultContinue reading “Java Access Modifiers/Specifiers :”

SUB-PACKAGE IN JAVA

WHAT IS SUB-PACKAGE IN JAVA: Package inside the package is called the sub package The packages that come lower in the naming hierarchy are called “sub package“. Constructor In Java: A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created.  Unlike Java methods,Continue reading “SUB-PACKAGE IN JAVA”

PRIVATE ACCESS MODIFIER

In Private Access Modifier, Visible inside the same Class Only. More Restrictive Access Modifier. The scope of private modifier is limited to the class only. Private Data members and methods are only accessible within the class Class and Interface cannot be declared as private If a class has private constructor then you cannot create the object ofContinue reading “PRIVATE ACCESS MODIFIER”

DRY CONCEPT IN JAVA

DRY means DON’T REPEAT YOURSELF: A basic principle of software development aimed at reducing repetition of information. The DRY principle is stated as, “Every piece of knowledge or logic must have a single, unambiguous representation within a system.” NOTE:“In String Concept,only for Sring Class.We Can Create Objects or References Without Using New Keyword“ Code Reusability: As theContinue reading “DRY CONCEPT IN JAVA”

OBJECT ORIENTED PROGRAMMING

Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. OOPs Concepts: Object: Object is State and Behaviour.Continue reading “OBJECT ORIENTED PROGRAMMING”

Design a site like this with WordPress.com
Get started