coderz.py

Keep Coding Keep Cheering!

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

Python Class

As we discussed in the previous tutorial, a class is a virtual entity that can be thought of as an object’s blueprint. The class was created when it was instantiated. Let us illustrate this with an example. Assume a class is a building prototype. A building contains all the information about the floor, rooms, doors, […]

December 8, 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

Inheritance in C++

Inheritance refers to a class’s ability to derive properties and characteristics from another class. One of the most important aspects of Object-Oriented Programming is inheritance. This also allows: Code reusability  Quick implementation time Runtime polymorphism In inheritance, there are two kinds of classes: A parent class, also known as a base class, is a class whose […]

October 21, 2022 | C++ | No comments

Mutable keyword in C++

Mutable data members are those whose values can be changed in runtime even if the object’s type is constant. It is the polar opposite of constant. It is sometimes necessary to modify one or more data members of a class or struct using a const function, even if you do not want the function to […]

October 16, 2022 | C++ | No comments

static keyword in C++

When the static keyword is used, variable or data members or functions can no longer be changed. It is allocated for the lifetime of the program. The static keyword can be used with: Static Variables: Variables in a function, Variables in a class Static Members of Class: Class objects and Functions in a class Static Variables in […]

October 14, 2022 | C++ | No comments

Treemap class in Java Collection Framework

Along with the AbstractMap Class, the TreeMap class in Java is used to implement the Map interface and NavigableMap. Depending on which constructor is used, the map is sorted based on the natural ordering of its keys or by a Comparator specified at map creation time. TreeMap class declaration: where, K: It is the type of […]

August 2, 2022 | Java | No comments

LinkedHashSet class in Java Collection Framework

The LinkedHashSet class is an ordered HashSet with a doubly-linked List across all entries. This class is used when the iteration order must be maintained. The order of the elements in a HashSet is unpredictable, whereas a LinkedHashSet allows us to iterate through them in the order in which they were inserted. Declaration of LinkedHashSet: […]

July 30, 2022 | Java | No comments

Java.util.Collections Class

The Java Collections Framework includes the Collections class in the Java.util.Collections package.  The static methods that work with collections or return collections are essentially utilized with the collections class. If the collection or object supplied to the methods is null, all the methods of this class raise the NullPointerException. Syntax:  Collections class fields: Following are the […]

July 22, 2022 | Java | No comments

Java.lang.ThreadGroup- class in Java

A group of threads is created by ThreadGroup class. It provides a practical method for controlling thread groups collectively. This is especially useful when you need to pause and resume a number of connected threads. Every thread group, excluding the initial thread group, has a parent in the thread group tree.A thread is permitted to […]

July 11, 2022 | Java | No comments

Advertisement