Ankitha Reddy has Published 97 Answers

How do I remove a particular element from an array in JavaScript

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

To remove an element from an array, use the splice() method. JavaScript array splice() method changes the content of an array, adding new elements while removing old elements. The following are the parameters − index − Index at which to start changing the array. howMany − An integer indicating ... Read More

How to count unique elements in the array using java?

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

The interface Set does not allow duplicate elements, therefore, create a set object and try to add each element to it using the add() method in case of repetition of elements this method returns false − If you try to add all the elements of the array to a Set, ... Read More

List top JavaScript Frameworks

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

Dojo It is an open source modular JavaScript library came into existence to a develop cross-platform, applications and a websites. It was developed by Alex Russell, Dylan Schiemann and other contributors in 2004. AngularJS AngularJS is an open source web application framework. It was originally developed in 2009 by Misko ... Read More

How to check a String for palindrome using arrays in java?

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

To verify whether the given string is a palindrome (using arrays) Convert the given string into a character array using the toCharArray() method. Make a copy of this array. Reverse the array. Compare the original array and the reversed array. in case of match given string is a palindrome. ... Read More

What does the method clone() do in java?

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

The clone() method of the java.util.ArrayList class returns a shallow copy of this ArrayList instance(i.e. the elements themselves are not copied). Example import java.util.ArrayList; public class ArrayListDemo { public static void main(String args[]) { ArrayList<StringBuilder> arrlist1 = new ArrayList<StringBuilder>(); ... Read More

How to add items to an array in java dynamically?

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

Since the size of an array is fixed you cannot add elements to it dynamically. But, if you still want to do it then, Convert the array to ArrayList object.Add the required element to the array list.Convert the Array list to array.Exampleimport java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class AddingItemsDynamically ... Read More

Why do Java array declarations use curly brackets?

Ankitha Reddy

Ankitha Reddy

Updated on 30-Jul-2019 22:30:20

Curly brackets usually denote sets and ensembles while parenthesis usually in most Algol-based programming languages curly braces are used to declare arrays.

Previous 1 ... 4 5 6 7 8 9 10
Advertisements