Found 33676 Articles for Programming

8-bit game using pygame

Rohan Singh
Updated on 17-Apr-2023 09:27:06

1K+ Views

Pygame is an open-source Python library used for making games. Pygame library provides various functions and tools for creating games, sound processing, and graphics.pygame library can be used to create games on any operating system like Windows, Linux, and macOS as pygame is a cross-platform library. What is an 8-bit Game? The 8-bit game was very popular in the 1980s. The 8-bit video games included graphics and sound that were created using 8-bit technology i.e a limited color palette and sound range that fall within the 8-bit range were used to create such video games. In this article, we will ... Read More

8 Tips For Object-Oriented Programming in Python

Rohan Singh
Updated on 17-Apr-2023 09:22:44

1K+ Views

Object-oriented programming language is a programming paradigm that is widely used in software design as it makes the code reusable and reduces code redundancy. It uses classes and objects to implement real-world objects in programming. Python and other languages like C++, java, javascript, etc support object-oriented programming. In this article, we will understand the characteristics of object-oriented programming and some tips to use object-oriented programming in Python. In object-oriented programming, objects are created from their class blueprint. These objects represent real-world objects as they have some properties called attributes and methods just like real-world objects have their own properties and ... Read More

7 Useful String Function in Python

Rohan Singh
Updated on 13-Apr-2023 10:46:32

594 Views

String is a data type in python which is widely used for data manipulation and analysis in machine learning and data analytics. Python is used in almost every technological development like web development, app development, desktop app development, game development, machine learning, artificial intelligence and data analysis etc. Python provides various inbuilt string functions that can be used to manipulate and process string data. In this article we will discuss 7 useful string functions in Python. len() len() function is used to find the length of the string. It returns a number which specifies the number of characters in the ... Read More

7 Reasons Why You Should Learn Python in 2023

Rohan Singh
Updated on 13-Apr-2023 10:40:41

454 Views

Python programming language was developed in 1991 and is a open source programming language. In the recent years python has gained immense popularity and has a huge developer support ecosystem which makes it easy to use and a versatile programming language. With its easy to understand syntax it is one of the best beginner programming languages to start with. It is widely used in different technological fields like web development, Game development, Machine learning, Artificial intelligence and Data Analytics by businesses. In this article we will see why you should learn the Python programming language in 2023. Reasons Why ... Read More

Java program to show inherited constructor calls parent constructor by default

Rudradev Das
Updated on 18-Nov-2024 22:30:58

335 Views

In this article, we will learn about constructors in Java. Constructors initialize objects when they are created. We will also see how the parent constructor is called in inheritance. Problem StatementWe will demonstrate possible approaches to show how the inherited constructor calls the parent constructor by default.Different approaches The following are the different approaches to show how the inherited constructor calls the parent constructor by default− Demonstrating inheritance properties ... Read More

Java Program to Show Different Access Levels

Rudradev Das
Updated on 02-Jan-2025 19:12:41

263 Views

In this article, we will explore the use of access modifiers in Java by demonstrating their functionality in different scenarios. Access Modifiers Access modifiers are used to set the feature of visibility of some particular classes, interfaces, variables, methods, constructors, data members, and the setter methods in Java programming language. In a Java environment, we have different types of access modifiers. Default - If we declare a function, it will be visible only within a particular package. ... Read More

Java program to set minimum and maximum heap size

Rudradev Das
Updated on 15-Oct-2024 10:39:06

722 Views

The Java heap is a particular memory area which is used to store the objects and represent them as or by an instance in Java Virtual Machine. The Java heap can be shared between two threads as long as the environment is occupied by some running applications. The heaps are sorted in a stack memory and follow the Last In First Out (LIFO) method after the creation of an object in JVM. When the size of the heap memory is compared to the stack, the spare objects are cleared by the GarbageCollector automatically. The heap memory is divided into three ... Read More

Java Program to Separate the Individual Characters from a String

Rudradev Das
Updated on 12-Apr-2023 17:40:29

5K+ Views

In the field of computer science, the string is a collection of a continuous character data sets. Here in this particular problem we will use some spaces to execute the logic. The individual characters present here in the string can be accessed through its index to perform the code. Here is a general flow to build a logic code to separate the individual characters from a string in a Java environment. Define a string with characters. Print the individual characters present from a given string. Set an initial to zero. Print the string by using the function string.charAt(i). Iterate ... Read More

Java Program to Illustrate String Interpolation

Shriansh Kumar
Updated on 31-Jul-2024 19:53:44

1K+ Views

String interpolation is a concatenation technique used to display output text dynamically or effectively by replacing the placeholder characters with variables (or strings in the subsequent examples). It restructures the code and prevents the need to repeatedly use variables to produce the output. It makes it efficient to write lengthy variable names or text just by replacing the placeholder with the variable names allocated to strings. String Interpolation in Java There are several ways in Java to perform String Interpolation with the help of the concatenation operator and library function or class. Here, we will discuss four different methods ... Read More

Java Program to Illustrate Use of Binary Literals

Sakshi Ghosh
Updated on 28-Jan-2025 18:23:53

545 Views

In this article, we will learn to illustrate the use of binary literals in Java. This feature is particularly useful when working with low-level data manipulation, such as in embedded systems or when dealing with bitwise operations. What is Binary Literal? A binary literal is a number that is denoted using binary digits that are 0s and 1s. The values written in data types – byte, int, long, and short can be easily expressed in a binary number system. The prefix 0b or 0B is added to the integer to declare a binary literal. For example − ... Read More

Advertisements