Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10740 Articles
AmitDiwan
482 Views
Two numbers are said to be co-primes if there exists no common prime factor amongst them (1 is not a prime number)For example −4 and 5 are co-primes 9 and 14 are co-primes 18 and 35 are co-primes 21 and 57 are not co-prime because they have 3 as the ... Read More
AmitDiwan
139 Views
We are required to write a JavaScript function that finds how many times a specific letter is appearing in the sentenceExampleLet’s write the code for this function −const string = 'This is just an example string for the program'; const countAppearances = (str, char) => { let count = ... Read More
AmitDiwan
164 Views
We are required to write a JavaScript function that takes in three numbers A, B and N, and finds the total number of N-digit numbers whose sum of digits at even positions and odd positions are divisible by A and B respectively.ExampleLet’s write the code for this function −const indexSum ... Read More
AmitDiwan
577 Views
Let’s say, we are required to write a JavaScript function that takes in an array and a number n and rotates the array by n elementsFor example: If the input array is −const arr = [12, 6, 43, 5, 7, 2, 5];and number n is 3, Then the output should ... Read More
AmitDiwan
255 Views
EnumerationIterator doesn’t have the option of eliminating elements from the collection, whereas an iterator has this facility. An additional disadvantage of using EnumerationIterator is that the name of methods associated with EnumerationIterator is difficult to remember.ExampleFollowing is an example − Live Demoimport java.util.Vector; import java.util.Enumeration; public class Demo { public ... Read More
AmitDiwan
275 Views
Following is an example to retrieve elements from Collection in Java-ListIterator −Example Live Demoimport java. util.* ; public class Demo { public static void main(String args[]) { Vector my_vect = new Vector(); my_vect.add(56); my_vect.add(78); my_vect.add(98); ... Read More
AmitDiwan
403 Views
Following is an example to retrieve elements −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { HashSet my_hs = new HashSet() ; my_hs.add("Joe"); my_hs.add ("Rob"); Iterator my_it = my_hs.iterator(); System.out.println("The ... Read More
AmitDiwan
343 Views
The ‘for-each’ loop is used to iterate over a set of elements that is stored in a data structure.Syntaxfor (element e: collection) { System.out.println(e); }ExampleFollowing is an example − Live Demopublic class Demo { public static void main(String[] args) { int[] my_vals = {5, 67, 89, ... Read More
AmitDiwan
610 Views
The array class present in java.lang.reflect package belong to the Java reflection class. The Java Reflection class provides static methods, and these methods can be used to create and access Java arrays in a dynamic manner. This class is final, and this means it can’t be changed or even instantiated. ... Read More
AmitDiwan
753 Views
A semaphore is used to control access to a shared resource when a process is being executed. This is done with the help of a counter. When this counter value is greater than 0, access to share resource is provided. On the other hand, if the value of counter is ... Read More