Arushi has Published 168 Articles

How to find the vowels in a given string using Java?

Arushi

Arushi

Updated on 07-Oct-2023 02:01:20

22K+ Views

You can read a character in a String using the charAt() method. To find the vowels in a given String you need to compare every character in it with the vowel letters. Example Live Demo public class FindingVowels {    public static void main(String args[]) {     ... Read More

How to automatically redirect a Web Page to another URL?

Arushi

Arushi

Updated on 12-Sep-2023 00:58:59

32K+ Views

Page redirection is a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header ... Read More

Computer Network Components

Arushi

Arushi

Updated on 02-Sep-2023 11:47:14

56K+ Views

Computer networks components comprise both physical parts as well as the software required for installing computer networks, both at organizations and at home. The hardware components are the server, client, peer, transmission medium, and connecting devices. The software components are operating system and protocols.The following figure shows a network along ... Read More

Multiple inheritance by Interface in Java

Arushi

Arushi

Updated on 02-Sep-2023 10:19:21

68K+ Views

An interface contains variables and methods like a class but the methods in an interface are abstract by default unlike a class. Multiple inheritance by interface occurs if a class implements multiple interfaces or also if an interface itself extends multiple interfaces.A program that demonstrates multiple inheritance by interface in ... Read More

Use overloaded methods to print array of different types in Java

Arushi

Arushi

Updated on 30-Jun-2020 08:38:41

725 Views

In method overloading, the class can have multiple methods with the same name but the parameter list of the methods should not be the same.Overloaded methods can be used to print an array of different types in Java by making sure that the parameter list of the methods contains different ... Read More

Role of Matcher.matches() method in Java Regular Expressions

Arushi

Arushi

Updated on 30-Jun-2020 08:32:13

68 Views

The method java.time.Matcher.matches() matches the given region against the specified pattern. It returns true if the region sequence matches the pattern of the Matcher and false otherwise.A program that demonstrates the method Matcher.matches() in Java regular expressions is given as follows −Example Live Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo { ... Read More

Create a Read-Only Collection in Java

Arushi

Arushi

Updated on 30-Jun-2020 08:28:36

89 Views

An example of a read-only collection can be an unmodifiable ArrayList. The unmodifiable view of the specified ArrayList can be obtained by using the method java.util.Collections.unmodifiableList(). This method has a single parameter i.e. the ArrayList and it returns the unmodifiable view of that ArrayList.A program that demonstrates this is given ... Read More

Loop through the Vector elements using a ListIterator in Java

Arushi

Arushi

Updated on 30-Jun-2020 08:21:33

89 Views

A ListIterator can be used to traverse the elements in the forward direction as well as the reverse direction in a Vector. The method hasNext( ) in ListIterator returns true if there are more elements in the Vector while traversing in the forward direction and false otherwise. The method next( ... Read More

Find the maximum element of a Vector in Java

Arushi

Arushi

Updated on 30-Jun-2020 08:20:22

737 Views

The maximum element of a Vector can be obtained using the java.util.Collections.max() method. This method contains a single parameter i.e. the Vector whose maximum element is determined and it returns the maximum element from the Vector.A program that demonstrates this is given as follows −Example Live Demoimport java.util.Collections; import java.util.Vector; public ... Read More

Perform Binary Search in Java using Collections.binarySearch

Arushi

Arushi

Updated on 30-Jun-2020 08:14:53

189 Views

Binary Search can be performed in Java using the method java.util.Collections.binarySearch(). This method requires two parameters i.e. the list in which binary search is to be performed and the element that is to be searched. It returns the index of the element if it is in the list and returns ... Read More

1 2 3 4 5 ... 17 Next
Advertisements