coderz.py

Keep Coding Keep Cheering!

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

Runtime Polymorphism

Polymorphism: Polymorphism is a Java concept that allows us to perform a single action in multiple ways. Polymorphism is made up of two Greek words: polymorphism and morphism. The words “poly” and “morphs” both mean “many.” Polymorphism denotes the presence of multiple forms. Types of polymorphism: compile-time polymorphism runtime polymorphism. Polymorphism in Java is achieved […]

May 25, 2022 | Java | No comments

Method Overriding in Java

In Java, method overriding occurs when a subclass (child class) has the same method as the parent class. Overriding is a feature that allows a subclass or child class to implement a method that is already provided by one of its super-classes or parent classes. When a subclass’s method has the same name, parameters, signature, […]

May 21, 2022 | Java | No comments

Method Overloading

Method Overloading in Java: Method Overloading occurs when a class has multiple methods with the same name but different parameters. Compile-time (or static) polymorphism is linked to overloading. The readability of the program is improved by method overloading. We don’t have to develop new names for functions that do the same thing. Overloading the method […]

May 21, 2022 | Java | No comments

Association, Composition & Aggregation in Java

Association: Association is a relation between two separate classes which establishes through their Objects. One-to-one, one-to-many, many-to-one, and many-to-many associations are all possible. An Object communicates with another object to use its functionality and services in Object-Oriented programming. Composition and Aggregation are the two forms of association. Composition: The strongest type of association is composition. It represents part-of relationship. If […]

May 21, 2022 | Java | No comments

Inheritance in Java

In Java, inheritance is a mechanism by which one object inherits all of its parent’s properties and behaviors. It is an essential component of OOPs (Object-Oriented programming systems). You can use the parent class’s methods and fields when you inherit from an existing class. You can also add new methods and fields to your current […]

May 19, 2022 | Java | No comments

Non-access modifiers

Non-access modifiers provide the JVM with information about a class, method, or variable’s characteristics. In Java, there are seven different types of Non-Access modifiers: static final abstract synchronized volatile transient native Static: The static keyword indicates that the entity to which it is applied is accessible from any instance of the class. The static keyword […]

May 17, 2022 | Java | No comments

Advertisement