- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 951 Articles
Maruthi Krishna
3K+ Views
The following is the regular expression to match the date in the dd-MM-yyyy format.^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$To match a date in a string in that format.Compile the above expression of the compile() method of the Pattern class.Get the Matcher object bypassing the required input string as a parameter to the matcher() method of ... Read More
Maruthi Krishna
306 Views
The java.util.function.UnaryOperator interface and can be used as assignment target for lambda expressions, it represents operation on a single operand whose result will be of same type as the input. We can create our own UnaryOperator by implementing this interface.The replaceAll() method of the List interface accept an object of ... Read More
Maruthi Krishna
614 Views
The ArrayList and, LinkedList classes implements the List interface of the java.util package. This interface provided two variants of the remove() method to remove particular elements as shown below −E remove(int index)boolean remove(Object o) −Using one of these methods you can delete a desired element from the List or, linkedList ... Read More
Maruthi Krishna
1K+ Views
Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class accepts, dynamically. By defining a class ... Read More
Maruthi Krishna
460 Views
The character classes in Java regular expression is defined using the square brackets "[ ]", this subexpression matches a single character from the specified or, set of possible characters. For example the regular expression [abc] matches a single character a or, b or, c.The union variant of the character class ... Read More
Maruthi Krishna
93 Views
The character classes in Java regular expression is defined using the square brackets "[ ]", this subexpression matches a single character from the specified or, set of possible characters. For example, the regular expression [abc] matches a single character a or, b or, c.The range variant of the character class ... Read More
Maruthi Krishna
3K+ Views
The character classes in Java regular expression is defined using the square brackets "[ ]", this subexpression matches a single character from the specified or, set of possible characters.For example the regular expression [abc] matches a single character a or, b or, c. Similarly, "[a-z]" matches a single character from ... Read More
Maruthi Krishna
699 Views
To match/search a input data with multiple lines −Get the input string.Split it into an array of tokens by passing "\r?" as parameter to the split method.Compile the required regular expression using the compile() method of the pattern class.Retrieve the matcher object using the matcher() method.In the for loop find ... Read More
Maruthi Krishna
91 Views
The split() method of the String class accepts a regular expression, splits the current input text into tokens and returns them as a string array.Example Live Demoimport java.util.Scanner; public class Example{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter input ... Read More
Maruthi Krishna
2K+ Views
Named capturing groups allows you to reference the groups by names. Java started supporting captured groups since SE7.Example Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ReplaceAll{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter input text: "); ... Read More