coderz.py

Keep Coding Keep Cheering!

Interface in Java

In Java, an interface is a blueprint for a class. It has abstract methods and static constants. In Java, the interface is a means of achieving abstraction. The Java interface can only have abstract methods, no method bodies. In Java, it is used to achieve abstraction as well as multiple inheritance. Java Interface also represents the […]

June 3, 2022 | Java | No comments

Abstract Class & Method in Java

In Java, an abstract class is specified with the abstract keyword. Both abstract and non-abstract methods can be used (method with the body).Note: Abstraction is the process of hiding implementation details from the user and only displaying functionality. A class that is declared using the abstract keyword is known as an abstract class. Abstract classes […]

June 3, 2022 | Java | No comments

Sub packages in Java

The subpackage is a package within a package. It should be developed to further categorize the package. Sub packages are identical to packages, with the exception that they are defined within other packages. Sub packages are similar to subdirectories, which are directories within directories. Sub packages in themselves are packages, so you have to use/access […]

June 3, 2022 | Java | No comments

Packages in Java

In Java, a package is a container for a collection of classes, sub-packages, and interfaces. The package keyword is used to create a package in java. Packages are used for the following purposes: Keeping naming conflicts at bay. For example, in two packages, college.staff.cse.Employee and college.staff.ee.Employee, there could be two classes named Employee. Making it easier to […]

June 3, 2022 | Java | No comments

instanceof Operator in Java

The instanceof operator is used to determine whether or not a reference variable contains a specific type of object reference. Because it compares the instance to the type, the instanceof operator in Java is also known as the type comparison operator. It either returns true or false. We get false when using the instanceof operator […]

June 3, 2022 | Java | No comments

Final keyword in Java

In Java, the final keyword is used to restrict the user. The final keyword in Java can be used in a variety of situations. Finally, you could say: variable method class The final keyword can be used with variables to create a final variable with no value. It’s also known as an uninitialized final variable […]

May 28, 2022 | Java | No comments

Static keyword in Java

In Java, the static keyword is mostly used to control memory. It is also used to share a class’s identical variable or method. Static keywords can be used with variables, methods, blocks, and nested classes. The static keyword refers to a class rather than a specific instance of that class. A constant variable or a […]

May 28, 2022 | Java | No comments

Garbage Collection in Java

Garbage collection is the method through which Java programs maintain their memory automatically. working: Java programs are compiled into bytecode that may be executed by a Java Virtual Machine, or JVM. Objects are produced on the heap, which is a part of memory dedicated to the Java application, while it runs on the JVM. Some […]

May 28, 2022 | Java | No comments

this keyword in Java

this is a Java keyword that refers to the current object of a class. Uses of this keyword: The following are some examples of how to utilize this keyword: this can be used to refer to the current instance variable of a class. this can be used to call the method of the current class […]

May 27, 2022 | Java | No comments

Difference between method overloading and method overriding

In Java, there are numerous distinctions between method overloading and method overriding. The following is a list of the differences between method overloading and method overriding: No. Method Overloading Method Overriding 1) To make the program more readable, method overloading is used. Method overriding is used to provide a specific implementation of a method that […]

May 25, 2022 | Java | No comments

Advertisement