Found 26504 Articles for Server Side Programming

Difference Between Iterator and Enumeration Interface in Java

AmitDiwan
Updated on 24-Mar-2021 12:34:07

567 Views

In this post, we will understand the difference between iterator and enumeration interfaces in Java.IteratorIt is a universal cursor.It can be applied to all collection of classes.It contains the ‘remove’ method.It is not a legacy interface.It can be used to traverse over HashMap, LinkedList, ArrayList, HashSet, TreeMap, and TreeSet .It can perform modifications to perform operations on the collection while traversing through it.EnumerationIt is not a universal cursor.It is applied only to legacy classes.It doesn’t contain the ‘remove’ method.It is a legacy interface.This interface acts like a read-only interface.Hence, no modifications can be performed on a collection while traversing over ... Read More

Difference Between HashMap and TreeMap in Java

Pradeep Kumar
Updated on 29-Jul-2022 11:42:50

3K+ Views

Both HashMap and TreeMap are considered to be Map classes because they both carry out the responsibilities of the Map interface. A Map is an object that stores key-value pairs, in which there is only one instance of each key but there may be multiple instances of the value. The hash table is a type of data structure that is utilised by the HashMap class. As a form of data storage, the red-black tree is utilised by the TreeMap.What is a HashMap?A HashMap uses a data structure known as the hash table in order to store the map's key-value pair. ... Read More

C program to find the sum of arithmetic progression series

Bhanu Priya
Updated on 24-Mar-2021 12:55:26

2K+ Views

ProblemFind the sum of an arithmetic progression series, where the user has to enter first number, total number of elements and the common difference.SolutionArithmetic Progression (A.P.) is a series of numbers in which the difference of any two consecutive numbers is always the same. Here, total number of elements is mentioned as Tn.Sum of A.P. Series: Sn = n/2(2a + (n – 1) d) Tn term of A.P. Series: Tn = a + (n – 1) dAlgorithmRefer an algorithm given below to find the arithmetic progression.Step 1: Declare variables. Step 2: Initialize sum=0 Step 3: Enter first number of series ... Read More

C program to generate an electricity bill

Bhanu Priya
Updated on 24-Mar-2021 12:54:05

10K+ Views

Based on the units consumed by the user, the electricity bill is generated. If number of units consumed are more then, the rate of a unit charge will also increase.The logic applied if minimum units are consumed by the user is as follows −if (units < 50){    amt = units * 3.50;    unitcharg = 25; }The logic applied if units are in between 50 to 100 is given below −else if (units

How to add two complex numbers by passing structure to a function in C language?

Bhanu Priya
Updated on 24-Mar-2021 12:36:51

7K+ Views

In order to add two complex numbers in C programming language, the user has to take two complex numbers as structure members and perform addition operation on those two numbers by creating a user-defined function.AlgorithmRefer an algorithm given below for addition of two complex numbers.Step 1: Declare struct complex with data members. Step 2: Declare name for structure and variables. Step 3: Enter real and imaginary part for first complex number at run time. Step 4: Enter real and imaginary part for second complex number at runtime Step 5: Compute addition of number1 and number2 by calling function. Go to ... Read More

Difference Between B-tree and Binary tree

Kiran Kumar Panigrahi
Updated on 20-Feb-2023 16:14:47

7K+ Views

There are two types of non-linear data structures namely, B-Tree and Binary Tree. These two terms sound similar but they are absolutely different from each other. The most basic difference between a B-Tree and a Binary Tree is that a B-Tree is used for data storage on a disk, whereas a Binary Tree is used for data storage in RAM. Read this article to learn more about B-tree and Binary Tree and how they are different from each other. What is a B-Tree? B-Tree, also called Balanced Sort Tree, is a type of balanced M-way tree. In a B-tree, the ... Read More

Difference Between Syntax and Semantics

Kiran Kumar Panigrahi
Updated on 22-Feb-2023 14:30:33

20K+ Views

Syntax defines the rules and regulations that help write any statement in a programming language, while semantics refers to the meaning of the associated line of code in the programming language. Read this article to learn more about syntax and semantics and how they are different from each other. What is Syntax? In a programming language, Syntax defines the rules that govern the structure and arrangement of keywords, symbols, and other elements. Syntax doesn't have any relationship with the meaning of the statement; it is only associated with the grammar and structure of the programming language. A line of ... Read More

Difference Between Private and Protected in C++

Nishu Kumari
Updated on 03-Mar-2025 13:16:34

1K+ Views

In this article, we'll explain the difference between private and protected access specifiers in C++. Access specifiers in C++ control who can access the variables and functions inside a class. Two commonly used specifiers are private and protected. Private members are accessible only within the class, while protected members can be accessed by the class and its derived classes. We'll show how each specifier works in C++, especially with inheritance, using simple examples to make it easy to understand. Private Access Modifier When we declare a class member as private, it means that this member is only accessible within ... Read More

How to use Boto3 to get the specified version table definition of a database from AWS Glue Data Catalog?

Ashish Anand
Updated on 23-Mar-2021 06:49:23

298 Views

Problem Statement − Use boto3 library in Python to retrieve the table definition of a database.Example − Retrieve the table definition of a database ‘QA-test’ and table as ‘security’ for version 2.Approach/Algorithm to solve this problemStep 1 − Import boto3 and botocore exceptions to handle exceptions.Step 2 − database_name, table_name and version_id is the mandatory parameter. It fetches definition of given table for a specified version.Step 3 − Create an AWS session using boto3 library. Make sure region_name is mentioned in default profile. If it is not mentioned, then explicitly pass the region_name while creating the session.Step 4 − Create ... Read More

How to use Boto3 to get the table definition of a database from AWS Glue Data Catalog?

Ashish Anand
Updated on 23-Mar-2021 06:48:59

2K+ Views

Problem Statement − Use boto3 library in Python to retrieve the table definition of a database.Example − Retrieve the table definition of a database ‘QA-test’ and table as ‘security’.Approach/Algorithm to solve this problemStep 1 − Import boto3 and botocore exceptions to handle exceptions.Step 2 − database_name and table_name is the mandatory parameter. It fetches the definition of given table.Step 3 − Create an AWS session using boto3 library. Make sure region_name is mentioned in default profile. If it is not mentioned, then explicitly pass the region_name while creating the session.Step 4 − Create an AWS client for glue.Step 5 − ... Read More

Advertisements