coderz.py

Keep Coding Keep Cheering!

Float class in Java

The Float class is a wrapper class for the primitive type float. It contains several methods for dealing with float values effectively, such as converting them to string representations and vice versa. A Float object can only hold one float value. Constructor of float wrapper class: There are mainly two constructors to initialize a Float […]

August 27, 2022 | Java | No comments

Short class in Java

The Short class is a wrapper class for the primitive type short. It contains several methods for dealing with short values effectively, such as converting them to string representations and vice versa. Constructors: To initialize a Short object, there are primarily two constructors- Methods of Short wrapper class: Methods Description int compareTo(Long b) -If the invoked […]

August 27, 2022 | Java | No comments

Wrapper Class in Java

A Wrapper class is one whose object contains or wraps primitive data types. When we create an object for a wrapper class, it has a field where we can store primitive data types. To put it another way, we can turn a primitive value into a wrapper class object. Wrapper Classes Are Required : They […]

August 20, 2022 | Java | No comments

Nested Class in Java

It is possible to define a class within another class in Java, and these classes are referred to as nested classes. They allow you to logically group classes that are only used in one place, increasing encapsulation and making code more readable and maintainable. Syntax: Note: The scope of the enclosing class limits a nested […]

June 11, 2022 | Java | No comments

Interface vs Abstract class

As we all know, abstraction refers to hiding the internal implementation of a feature and only giving the users the functionality. i.e. how it works (showing), what it does (showing) (hiding). Because an abstraction is achieved using both abstract classes and interfaces, Interface and Abstract classes are needed prerequisites. Let’s see the differences between them. […]

June 3, 2022 | Java | No comments

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

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

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

Advertisement