Articles on Trending Technologies

Technical articles with clear explanations and examples

How to convert a single character to string in C++?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 05-May-2025 499 Views

In C++, a single character is represented using a single quotation (' ') while a string is represented using a double quotation (" "). To change the single character into a string, use approaches like string_constructor, push_back(), etc., that solve the conversion. Example Input: ch = 'A' Output: str = A // "A" So, character A is converted to a string. C++ provides various approaches to convert single character into string as follows: Using string constructor Using push_back() Using stringstream ...

Read More

Difference Between int and long

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 05-May-2025 8K+ Views

In programming, int and long are the part of primitive data type. The int stores the integer value while long stores the larger range of values like a whole number. In this article, we will see the differences between int and long data types. int (Integer) Data Type The keyword int representing the integer value. It store the both positive and negative values such as -1, 45, -78, 85, etc., but not fractional and decimal values. The value ranges from –2, 147, 483, 648 to 2, 147, 483, 647. Behavior of int in Different Languages Following is the list of ...

Read More

How can we set a border to JCheckBox in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 05-May-2025 772 Views

In this article, we will learn to set a border for JCheckBox in Java. JCheckBox is a Swing component that is commonly used in user interface selection. Although it includes a default appearance, we can customize its look by setting borders in order to have a good visual effect. What is a JCheckBox? A JCheckBox is a component that extends JToggleButton, and an object of JCheckBox represents an option that can be checked or unchecked. Syntax The following is the syntax for JCheckBox initialization: JCheckBox Checkbox_name = new JCheckBox(); If there are two or more options, then any ...

Read More

How can we set the shortcut key to a JButton in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 05-May-2025 2K+ Views

In this article, we will learn to set the shortcut key to a JButton in Java. In Swing-based applications, we can implement the addition of keyboard shortcuts to buttons to enable quicker navigation by the user. What is a JButton? A JButton is a subclass of AbstractButton, and it can be used to add platform-independent buttons to a Java Swing application. When the button is pressed or clicked, a JButton can generate an ActionListener interface; it can also generate the MouseListener and KeyListener interfaces. Setting the Shortcut Key for JButton We can also set the shortcut keys for a JButton ...

Read More

How can we implement the word wrap JTableHeader of a JTable in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 05-May-2025 976 Views

In this article, we will learn to implement the word wrap JTableHeader of a JTable in Java. The Java Swing default JTableHeader does not support word wrapping. This is a problem if you have long column headers. We can implement this by customizing the DefaultTableModel class or the AbstractTableModel class. JTableHeader A JTableHeader is a subclass of the JComponent class. When we create a JTable object, the constructor creates a new JTableHeader object to manage the table component's header. Syntax The following is the syntax for JTableHeader Declaration: public class JTableHeader extends JComponent The JTableHeader object is associated with ...

Read More

How to read/parse JSON array using Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 05-May-2025 61K+ Views

In this article, we will learn to read/parse a JSON array using Java. A JSON array is an ordered collection of values that are enclosed in square brackets, i.e., it begins with ‘[’ and ends with ‘]’. The values in the arrays are separated by ‘, ’ (comma). Sample JSON array The following is the syntax for JSON array initialization: { books": [ Java, JavaFX, Hbase, Cassandra, WebGL, JOGL] } Reading (Parsing) JSON array in Java The following are the different approaches for reading/parsing a JSON array in Java: JSON-Simple maven dependency ...

Read More

C++ Program to Implement Graph Structured Stack

Farhan Muhamed
Farhan Muhamed
Updated on 05-May-2025 772 Views

In this article, we will learn what is graph structured stack and how to implement it in a C++ program. What is Graph Structured Stack? Graph structured stack is a directed acyclic graph, where each directed path represents a stack. In this types of stack, the flow of execution is not linear like a traditional stack, instead the flow is represented using a graph structure. Each node in the graph can represent a function call or a state, and the edges define possible transitions or calls. This type of stacks are useful in advanced control flow handling like backtracking, ...

Read More

C++ Program to Implement Bit Array

Farhan Muhamed
Farhan Muhamed
Updated on 05-May-2025 3K+ Views

Bit array is used to store true/false or yes/no type of values in very less memory. In this article, we will see how to create and use a bit array in C++. What is Bit Array? Bit array is a special array where each element can hold only 0 or 1. Instead of using a full byte (8 bits) for each boolean value, a bit array stores multiple values using just one bit each. Meaning, in a normal array of bool values, each value takes at least one byte. But in bit array, we store 8 values in one ...

Read More

How ai can help you perform better in exams?

Harleen Kaur
Harleen Kaur
Updated on 05-May-2025 250 Views

AI tools can greatly improve your performance and confidence, whether you're in school, college, or getting ready for competitive tests. Read this article to understand how AI can help students prepare better for their exams by delivering intelligent practice tools.How AI can Help you Perform Better in Exams?Specific EducationEvery child learns differently. Some like to read or listen, while others like to understand blind subjects. The platforms powered by AI adjust the speed, qualifications and deficiencies of each student. Through quiz and analysis, these technologies evaluate your knowledge and then change lessons to focus on areas that want to improve. ...

Read More

What is double address operator(&&) in C++?

Akansha Kumari
Akansha Kumari
Updated on 05-May-2025 21K+ Views

&& is a new reference operator defined in the C++11 standard. int&& a means "a" is an r-value reference. && is normally only used to declare a parameter of a function. And it only takes an r-value expression.Simply put, an r-value is a value that doesn't have a memory address. E.g., the number 6 and character 'v' are both r-values. int a, a is an l-value, however, (a+2) is an r-value. Example #include using namespace std; void foo(int&& a) { cout

Read More
Showing 30991–31000 of 61,297 articles
Advertisements