Skip to content

Category Archives: Java Programs

A Rectangle is a quadrilateral with four right angles (90°). In a rectangle, the opposite sides are equal. A rectangle with all four sides equal… Read More
The pair class in C++ Standard Library is used a lot.  We can implement our own user-defined pair class in Java and its object can… Read More
A feedback vertex set of a graph is a set of vertices whose removal leaves a graph without cycles. The following graph becomes a Directed… Read More
In a graph with V vertices and E edges, the LIS (Largest Independent Set) is the set of all the vertices in the graph which… Read More
String Class stripLeading() method is used to strip leading whitespaces from the string i.e stripLeading() method removes all the whitespaces only at the starting of… Read More
The writeString() method of File Class in Java is used to write contents to the specified file. Syntax: Files.writeString(path, string, options) Parameters:  path – File… Read More
The readString() method of File Class in Java is used to read contents to the specified file. Syntax: Files.readString(filePath) Parameters:  path - File path with… Read More
In order to negate an existing predicate, the Predicate.not() static method added to Java 11. The Predicate class is present in java.util.function package. Syntax: negate = Predicate.not(… Read More
Pattern searching is a crucial problem in computer science. When we do search for a string in notepad/word file or browser or database, pattern searching… Read More
If we want to access Private Field and method using Reflection we just need to call setAccessible(true) on the field or method object which you… Read More
Enumerations serve the purpose of representing a group of named constants in a programming language. Enums are used when we know all possible values at… Read More
Resources are the collections of files or images or stuff of other formats. Java programs help us to load these files or images of the… Read More
If we have the Date object of the SQL package, then we can easily convert it into an util Date object. We need to pass… Read More
Given a string, write a Java program to replace all line breaks from the given String. Examples Input - Geeks For Geeks Output - Geeks… Read More
As we know that in a calendar year, there are a total of 12 Months. In order to convert the name of months to a… Read More

Start Your Coding Journey Now!