-
Abstraction
Abstract Classes and Methods: Data abstraction is the process of hiding certain details and showing only essential information to the user.Abstraction can be achieved with either abstract classes or interfaces . The abstract keyword is a non-access modifier, used for classes and methods: Points to Remember: Abstract Class: A class which contains the abstract keyword in its declaration is known as abstract class. Java Abstract…
-
Static Block and Non-Static Block
Static Initialization Block in Java: When a block is declared with the static keyword, it is called static block in Java. It is a normal block of code that is enclosed in braces ({ }) and is preceded by a keyword “static”. Static block is also known as static initialization block or static initializer block in Java.…
-
Protected keyword
protected keyword: A Java protected keyword is an access modifier. It can be assigned to variables, methods, constructors and inner classes. The methods or data members declared as protected can be accessed from, Points to remember: Reference: https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html https://www.javatpoint.com/protected-keyword-in-java https://www.baeldung.com/java-protected-access-modifier https://www.geeksforgeeks.org/protected-keyword-in-java-with-examples/ TBD: I didn’t declare any static variable but I got error
-
Difference between
Method overloading and method overriding in java No. Method Overloading Method Overriding 1) Method overloading is used to increase the readability of the program. Method overriding is used to provide the specific implementation of the method that is already provided by its super class. 2) Method overloading is performed within class. Method overriding occurs in two classes that have IS-A (inheritance) relationship.…
-
Method Overriding and Super keyword
Method Overriding: Declaring a method in sub class which is already present in parent class is known as method overriding. Overriding is done so that a child class can give its own implementation to a method (the same name, same parameters or signature, and same return type) which is already provided by the parent class. In this case the…
-
Inheritance
Java Inheritance (Subclass and Superclass): In Java, it is possible to inherit attributes and methods from one class to another. We group the “inheritance concept” (child object/ class behaves like parent object/class) into two categories: To inherit from a class, use the extends keyword. A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors…
-
Package
Java Packages & API: A package in Java is used to group related classes. Think of it as a folder in a file directory. We use packages to avoid name conflicts, and to write a better maintainable code. Packages are divided into two categories: Built-in Packages: The Java API is a library of prewritten classes, that…
-
News paper columns – css
Multiple column: save:mulcolumnlayout ouput: save:columnspan save:columnfragmentation save:responsivedesign