Articles on Trending Technologies

Technical articles with clear explanations and examples

How can I append a tuple into another tuple in Python?

Sindhura Repala
Sindhura Repala
Updated on 20-Apr-2025 12K+ Views

In this article, we will demonstrate how to append one tuple to another in Python. Below are various methods to achieve this task - Using + operator. Using sum() function. Using list() & extend() functions. ...

Read More

What is function of ^ operator in Python

Akshitha Mote
Akshitha Mote
Updated on 18-Apr-2025 1K+ Views

In Python, the XOR operator is one of the bitwise operators and is represented by the caret symbol ^. It returns 0 if both operands are the same and 1 if the operands are different. Truth Table of XOR The following is the truth table of the XOR (exclusive OR) operator - A B ...

Read More

Does Python have a ternary conditional operator?

Akshitha Mote
Akshitha Mote
Updated on 18-Apr-2025 394 Views

The Python ternary operator returns a value based on whether a condition is True or False. It is similar to an if-else statement but is expressed in a single line. For understanding the ternary operator, we need to have an idea about conditional statements. Let's have a basic understanding of the if-else statement. We will have an if block followed by an else block here. The if block is executed when the given condition is True,  and the else block is executed if the given condition is False. The following is the basic syntax of the if-else statement - if condition: ...

Read More

Extract all integers from string in C++

Farhan Muhamed
Farhan Muhamed
Updated on 18-Apr-2025 7K+ Views

In this article, we will discuss how to extract all the integers from a string using C++ program. We will explore all the possible approaches to do so. First of all, let's understand the problem statement. We have a string that contains a mix of digits and non-digits. We need to extract all the integers from the string and store them in a vector. The integers can be positive or negative. For example, // Input String string str = "ab24wj-123fow" // Output Vector vector vec = {24, -123} Approaches to Extract Integers from String ...

Read More

Java program to check if string is pangram

Shriansh Kumar
Shriansh Kumar
Updated on 18-Apr-2025 12K+ Views

The given task is to write a Java program to check whether a string is a pangram or not. A string is called a pangram if and only if it contains all the letters of the English alphabet, regardless of their case. Example Scenario:Let's understand the problem with an example - Input: "The quick brown fox jumps over the lazy dog" Output: Yes, the string is a pangram Read the input String, you can find all the letters of the English alphabet in it. Therefore, it is a pangram string. How to Check if a String is a Pangram ...

Read More

HAS-A relationship in Java

Shriansh Kumar
Shriansh Kumar
Updated on 18-Apr-2025 3K+ Views

Java is a programming language that follows the Object-Oriented Programming paradigm. One of the pillars of OOPs is Inheritance, where you can find a relationship between two classes as Parent and Child. This relationship allows these classes to reuse each other's attributes and methods. Java classes can relate to each other in many ways such as, Is-A relationship and Has-A relationship. In this article, we are going to learn the concept of Has-A relationship in Java through examples. HAS-A Relationship in Java Has-A relationship is a type of association where two classes are linked to each other through objects. Here, ...

Read More

What are the restrictions imposed on a static method or a static block of code in java?

Maruthi Krishna
Maruthi Krishna
Updated on 18-Apr-2025 5K+ Views

Static Methods and Static Blocks Static methods belong to the class and they will be loaded into memory along with the class; you can invoke them without creating an object. (using the class name as reference). Whereas a static block is a block of code with a static keyword. In general, these are used to initialize the static members. JVM executes static blocks before the main method at the time of class loading. Example The following example demonstrates the usage of static blocks and static methods in Java - public class Sample { ...

Read More

How many types of memory areas are allocated by JVM in java?

Maruthi Krishna
Maruthi Krishna
Updated on 18-Apr-2025 2K+ Views

Java Virtual Machine is a program/software that runs Java applications. It takes Java bytecode (.class files) and converts the bytecode (line by line) into machine-understandable code, line by line so the processor can understand and execute it. JVM contains a module(components) known as a class loader. It is responsible for loading the program into memory and preparing it to run. Class Loader performs three main tasks - It Loads the class into the memory. ...

Read More

What is the importance of the CardLayout class in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 18-Apr-2025 334 Views

In this article, we will learn about the importance of the CardLayout class in Java. In Swing, we usually have to manage a set of views and panels in a single container. The CardLayout class provides you with a flexible and powerful method to complete this, allowing you to switch between various components, such as cards in a deck. What is CardLayout? CardLayout is a layout manager in the Java AWT package. It is different from the other layouts, where the other layout managers attempt to display all the components within the container at once, the CardLayout displays only one ...

Read More

How can we disable the maximize button of a JFrame in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 18-Apr-2025 2K+ Views

In this article, we will learn to disable the maximize button of a JFrame in Java. When creating Swing GUIs in Java, we might occasionally want to prevent users from maximizing certain windows. Removing the maximize button will do the trick for dialog windows, tool windows, or any window where a fixed size needs to be kept. What is a JFrame? A JFrame is a class from javax. swing package and it can extend java.awt.frame class. It is a top-level window with a border and a title bar. A JFrame class has many methods that can be used to customize ...

Read More
Showing 20601–20610 of 61,301 articles
Advertisements