
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 10744 Articles

AmitDiwan
287 Views
Let’s say, we have an array of objects like this −data = [ {"Age":26, "Level":8}, {"Age":37, "Level":9}, {"Age":32, "Level":5}, {"Age":31, "Level":11}, {"Age":null, "Level":15}, {"Age":null, "Level":17}, {"Age":null, "Level":45} ];We are required to write a JavaScript function that calculates the average level for all the ... Read More

AmitDiwan
437 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
109 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
131 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
547 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
219 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
234 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
360 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
320 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
578 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