Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Ankith Reddy
730 articles
Printing Multi-Dimensional arrays in Java
A multi-dimensional array can be easily printed using java.util.Arrays.deepToString() in Java. This method converts the multi-dimensional array to string and prints the array contents enclosed in square brackets. What Are Multi-Dimensional Arrays? Multi-dimensional arrays allow you to store data in a matrix-like structure, providing a way to represent tables, grids, or more complex hierarchical data. The most common type is a two-dimensional array, but Java supports arrays with more than two dimensions. int[][] array = new int[rows][columns]; Using Naive Approach The Arrays.deepToString(arr) method from the Arrays class ...
Read MoreC++ Program to Perform Complex Number Multiplication
Complex numbers are numbers that are expressed as a+bi, where i is an imaginary number and a and b, are real numbers. Some examples of complex numbers are − 2+3i 5+9i 4+2i Example A program to perform complex number multiplication is as follows − #include using namespace std; int main(){ int x1, y1, x2, y2, x3, y3; cout y1; cout y2; x3 = x1 * x2 - y1 * y2; y3 = x1 * y2 + y1 * x2; cout
Read MoreNested Classes in C++
A nested class is a class that is declared in another class. The nested class is also a member variable of the enclosing class and has the same access rights as the other members. However, the member functions of the enclosing class have no special access to the members of a nested class. Syntax Here is the basic syntax defining and using nested classes in C++. class OuterClass { // Members of the outer classpublic: // Nested class definition class InnerClass { // Members of the inner class };}; Accessing Nested Classes To access a nested class from outside ...
Read MoreJava program to remove the first row from a table with DefaultTableModel
In this article, we will learn how to display a table with multiple rows and columns in Java using the JTable component. Additionally, we will demonstrate how to remove the first row from the table using the removeRow() method. The first program shows how to create and display a table with 9 rows, and the second program demonstrates how to remove the first row, leaving the remaining 8 rows intact. Create a table with rows and columns using JTable Following are the steps to create a table with rows and columns using JTable − Start ...
Read MoreJava program to accept an integer from user and print it
In this article, we will prompt the user to input an integer, and the entered value will be displayed back to them. To achieve this, we will use the Scanner class from java.util package, which allows us to read user input. Specifically, the nextInt() method of the Scanner class will be used to read the integer input from the user.Problem Statement Write a program in Java to accept an integer from the user and print it − Input Enter an integer: 2 Output Given integer is :: 2 Steps to accept an integer from the user and print it Following are ...
Read MoreJava program to find the circumference of a circle
The circumference of a circle is double the product of its radius and the value of PI. Therefore, to calculate the circumference of a circleGet the radius of the circle form the user.Calculate the productPrint the final result.Example: Finding the circumference of a circle import java.util.Scanner; public class CircumfrenceOfCircle { public static void main(String args[]){ int radius; double circumference; Scanner sc = new Scanner(System.in); System.out.println("Enter the radius of the circle ::"); radius = sc.nextInt(); circumference = Math.PI*2*radius; System.out.println("Circumference ...
Read MoreJava program to convert the contents of a Map to list
The Map class's object contains key and value pairs. You can convert it into two list objects one which contains key values and the one which contains map values separately. To convert a map to list − Create a Map object. Using the put() method insert elements to it as key, value pairs Create an ArrayList of integer type to hold the keys of the map. In its constructor call the method keySet() of the Map class. Create an ArrayList of String type to hold the values of the map. In ...
Read MoreRecycler view item animate when scrolling in Android
Before getting into Item animation for recycler view example, we should know what is Recycler view in android. Recycler view is a more advanced version of the list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items. card view is extended by frame layout and it is used to show items in card manner. It supports radius and shadow as predefined tags. This example demonstrates how to integrate Animation in Recycler View with card view by creating a beautiful student records app that displays student name with age. ...
Read MoreWhat is IEEE 802.3?
IEEE 802.3 is a set of standards and protocols that define Ethernet-based networks. Ethernet technologies are primarily used in LANs, though they can also be used in MANs and even WANs. IEEE 802.3 defines the physical layer and the medium access control (MAC) sub-layer of the data link layer for wired Ethernet networks.IEEE 802.3 Popular VersionsThere are a number of versions of IEEE 802.3 protocol. The most popular ones are.IEEE 802.3: This was the original standard given for 10BASE-5. It used a thick single coaxial cable into which a connection can be tapped by drilling into the cable to the ...
Read MoreTimers of 8051
In Intel 8051, there are two 16-bit timer registers. These registers are known as Timer0 andTimer1. The timer registers can be used in two modes. These modes areTimer mode and the Counter mode. The only difference between these two modes is the source for incrementing the timer registers. Timer ModeIn the timer mode, the internal machine cycles are counted. So this register is incremented in each machine cycle. So when the clock frequency is 12MHz, then the timer register is incremented in each millisecond. In this mode it ignores the external timer input pin.Counter ModeIn the counter mode, the external events ...
Read More