Samual Sam has Published 2363 Articles

How to clear console in C?

Samual Sam

Samual Sam

Updated on 14-Apr-2025 19:13:13

21K+ Views

In C, we have various methods to clear the console or output screen and one of them is clrscr() function. It clears the screen as function invokes. It is declared in "conio.h" header file. There are some other methods too like system (cls) and system ("clear") and these are declared ... Read More

What is the size of an object of an empty class in C++?

Samual Sam

Samual Sam

Updated on 11-Apr-2025 17:17:28

326 Views

The size of an object of an empty class in C++ is 1 byte as it allocates one unique address to the object in the memory. The size can not be 0, as the two objects can not have same memory allocation. In this article, we will see an example ... Read More

Java NumberFormat.getPercentageInstance() Method

Samual Sam

Samual Sam

Updated on 28-Jan-2025 14:58:02

554 Views

In this article, we will learn the NumberFormat.getPercentageInstance() method. Java provides powerful tools for formatting numbers, currencies, and percentages through the java.text.NumberFormatclass. One of the most useful methods in this class is the getPercentageInstance() method. NumberFormat.getPercentageInstance() method The NumberFormat.getPercentageInstance() method is a static method that returns a NumberFormat instance configured ... Read More

Java program to convert binary number to decimal number

Samual Sam

Samual Sam

Updated on 28-Jan-2025 14:51:45

790 Views

In this article, we will learn to convert a binary number into a decimal number in Java.Binary numbers are fundamental in computer science and digital electronics, where data is represented in a base-2 numeral system consisting of only 0s and 1s. Converting binary numbers to their decimal equivalents is a ... Read More

Java Program to Compare Strings

Samual Sam

Samual Sam

Updated on 23-Jan-2025 22:54:05

6K+ Views

In this article, we will compare two Strings in Java using the compareTo() method, equals() method, or == operator. Each approach serves a specific purpose in comparing strings, whether it's lexicographical comparison, checking for content equality, or comparing object references. Using the compareTo() methodThe ... Read More

Java Program to replace all occurrences of given String with new one

Samual Sam

Samual Sam

Updated on 23-Jan-2025 22:53:32

273 Views

In this article, we will learn how to replace all occurrences of a given string with a new one using the replaceAll() method in Java. This method is particularly useful when we want to modify specific parts of a string.   replaceAll() method The replaceAll() method in Java is used ... Read More

Java Program to copy all the key-value pairs from one Map into another

Samual Sam

Samual Sam

Updated on 26-Dec-2024 20:45:48

569 Views

In Java, maps are a powerful and versatile way to store key-value pairs. Often, you may find the need to merge the contents of one map into another. This can be done effortlessly using the putAll method available in the Map interface. Let's explore this functionality with an example and ... Read More

Split String with Dot (.) in Java

Samual Sam

Samual Sam

Updated on 26-Dec-2024 20:41:49

13K+ Views

In Java, strings are one of the most commonly used data types for storing text. Sometimes, you may need to split a string based on a specific delimiter, such as a dot (.). Java provides powerful string manipulation methods like split(). Split() method  The split() method of Java String is ... Read More

Static Keyword in C++

Samual Sam

Samual Sam

Updated on 10-Dec-2024 18:20:10

15K+ Views

When a static keyword is used, variables, data members, and functions can not be modified again. It is allocated for the lifetime of the program. Static functions can be called directly by using a class name. Key Points of Static Variables Static variables are variables that are defined using static ... Read More

C++ Program to Store Information of a Student in a Structure

Samual Sam

Samual Sam

Updated on 02-Dec-2024 00:24:49

6K+ Views

A structure is a collection of items of different data types. It is very useful in creating complex data structures with different data type records. A structure is defined with the struct keyword. Syntax Here is the following syntax of structure. struct employee {  int empID;  char name[50];  float salary; ... Read More

1 2 3 4 5 ... 237 Next
Advertisements