coderz.py

Keep Coding Keep Cheering!

Operator Overloading in Python

Operator overloading refers to providing meaning that extends beyond their predefined operational meaning. For example, the operator + can be used to add two integers, join two strings, or merge two lists. It is possible because the ‘+’ operator is overloaded by the int and str classes. Therefore, the different behavior of a single operator […]

December 18, 2022 | python | No comments

Static Keyword in Python

Class or Static Variables: In Python, a variable declared within a class but outside any method is referred to as a class or static variable. A class or static variable can be referred to, but not directly through an instance. Class or static variables are distinct from and do not conflict with other member variables […]

December 17, 2022 | python | No comments

Polymorphism in Python

What is Polymorphism? Polymorphism is derived from the Greek words poly (many) and morphism (change) (forms). That is, the same function name can be used for multiple types. This makes programming more intuitive and straightforward. Polymorphism can be defined in a variety of ways in Python. So, let’s start and look at how polymorphism works […]

December 16, 2022 | python | No comments

Method Overriding in Python

Method overriding is a feature of any object-oriented programming language 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 method in a subclass has the same name, parameters or signature, and return type (or sub-type) as a method in […]

December 15, 2022 | python | No comments

Access Modifiers in Python

When implementing the concepts of inheritance in Python code, access specifiers or access modifiers are used to restrict the access of class variables and methods outside the class. The three access modifiers most programming languages use are Public, Protected, and Private in a class. The access control for a particular data member or member function […]

December 13, 2022 | python | No comments

Object-Oriented Programming in Python

What Is Object-Oriented Programming? Alan Kay coined the term “Object-Oriented Programming” (OOP), also known as oops concepts in Python, in 1966 while in graduate school. Simula was the first programming language to include features of object-oriented programming. It was created in 1967 to create simulation programs in which the most important information was referred to […]

December 8, 2022 | python | No comments

OOPs Concepts in C++

Object-oriented programming (OOPs) is a programming approach or pattern in which programs are structured around objects rather than functions and logic. It partitions the data into two memory areas, namely data and functions, and aids in making the code flexible and modular. Concepts of an Object-Oriented Programming language: There are some basic concepts that act […]

September 20, 2022 | C++ | No comments

Character class in Java

In java.lang package, Java includes a wrapper class called Character. A single field of type char is contained in a Character object. The Character class provides several useful static (class) methods for manipulating characters. The Character constructor can be used to create a Character object. Constructor of Character wrapper class: Methods of Character Wrapper class: Methods […]

August 27, 2022 | Java | No comments

Boolean class in Java

In java.lang package, there is a wrapper class Boolean. A value of the primitive type boolean is wrapped in an object by the Boolean class. An object of type Boolean has a single field with the type boolean. Constructors for creating Boolean object: Methods of Boolean Wrapper class: Methods Description boolean booleanValue() Returns a primitive boolean […]

August 27, 2022 | Java | No comments

Double class in Java

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

August 27, 2022 | Java | No comments

Advertisement