
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
Found 9150 Articles for Object Oriented Programming

155 Views
Internationalization enhancements in Java 9 include Unicode 8.0, UTF-8 properties files and enabling CLDR locale data by default. Java 9 supports up to Unicode 8.0 standards with 10, 555 characters, 29 scripts, and 42 blocks.In Java 9, the properties files are loaded in UTF-8 encoding. By default, reading an input stream throws MalformedInputException or UnmappableCharacterException. In this case, PropertyResourceBundle instance reset to a state before the exception, re-reads the input stream in ISO-8859-1, and continues reading.If PropertyResourceBundle.encoding has set to either ISO-8859-1 or UTF-8, then PropertyResourceBundle instance read an input stream in that encoding, and throw an exception if encountering an invalid sequence. The system property read ... Read More

250 Views
In this article, we will learn to access each stack element of StackWalker in Java 9. We will learn about the StackWalker API and its methods, and use of getStackTrace() method for accessing each stack element. StackWalker API StackWalker API allows easy filtering and lazy access to execute tasks within any method. It is an efficient API for obtaining stack trace information in Java 9. StackWalker API is an alternative to Thread.getStackTrace() or Throwable.getStackTrace() and SecurityManager.getClassContext(). This API targets a mechanism to traverse and materialize required stack frames, allowing efficient lazy access to additional stack frames when required. The following ... Read More

515 Views
In Java 9, a new method added to the Collectors class: flatMapping(). It is similar to the Collectors.mapping() method in which the flatMapping() method allows us to handle nested collections. The Collectors.flatMapping() method takes a function to be applied to input elements and a collector to accumulate the elements passed through the function. Unlike the Collectors.mapping() method, the Collectors.flatMapping() method deals with a stream of elements that allows us to get rid of unnecessary intermediary collections.Syntaxpublic static Collector flatMapping(Function

395 Views
Collectors class is an essential part of the Stream API. In Java 9, a new method: filtering() added to the Collectors class. The Collectors.filtering() method can be used for filtering elements in a stream. It is similar to the filter() method on streams. The filter() method processes the values before they have grouped whereas the filtering() method can be used nicely with the Collectors.groupingBy() method to group the values before the filtering step takes place.Syntaxpublic static Collector filtering(Predicate

514 Views
JShell is an interactive tool introduced since Java 9. It is Java's first official REPL tool to create a simple programming environment in the command-line that reads the user's inputs, evaluates it, and prints the result.We can able to create a new JShell instance programmatically in Java language. JShell and its associated APIs can be found under jdk.jshell package. we can get a new instance for JShell by using the static method: create() of JShell class. The eval() method of JShell class used to add an expression to JShell instance. It returns a list of events triggered by the evaluation. It is exactly one ... Read More

945 Views
The primary objective of the Jigsaw project is to introduce the modularity concept to create a module in Java 9 and then applying the same to JDK.Below are some of the benefits of Modularity(Jigsaw)Strong Encapsulation: The modules can access only those parts that can be available for use. Unless the package is explicitly exported into the module-info.java file, public classes in a package can't be public.Clear Dependencies: A module must declare about other modules that they are used through the required clause. The modules are combined in order to create a shorter runtime that can be scaled to comparatively smaller computing ... Read More

2K+ Views
In this article, we will learn to use the readNBytes() method of InputStream in Java 9. We will get to know the InputStream Class with its methods as readNBytes() is a method of this class. After that, we will learn about the readNBytes() method with its syntax and when to use this method, along with an example. InputStream Class The Java InputStream class is the superclass of all classes representing an input stream of bytes. Every subclass of InputStream always needs to introduce a method to return the next byte on request. The following are some of the common methods of ... Read More

10K+ Views
In this article, we will learn to use the readAllBytes() method of InputStream in Java 9. We will get to know the readAllBytes() method with its syntax, then we will learn about the InputStream Class with its methods, and lastly, we will learn the use of readAllBytes() with an example What is the readAllBytes() Method? In Java 9, the readAllBytes() method reads all bytes from an InputStream object at once and blocks until all remaining bytes have been read and the end of the stream is detected, or an exception is thrown. It returns a byte array containing the ... Read More

2K+ Views
In this article, we will learn to get dates using the LocalDate.datesUntil() method in Java 9. We will learn about date ranges, skip or limit results and by using the Period class we will apply the custom steps. What is a LocalDate? LocalDate is a part of java.time package and is an immutable, date-time object, which often represents a date in the "year-month-day" format. For example, the value of "2nd May 2025" could be stored in a LocalDate. The following are the maximum and minimum values of the LocalDate: MAX: The maximum supported LocalDate, '+999999999-12-31'. ... Read More

544 Views
In this article, we will learn to get the date and time in JShell in Java 9. First, we will learn about the date and time class in Java with an example, and after that will learn about date and time in JShell with multiple examples. JShell JShell is an interactive command-line tool that allows us to learn, investigate, and explore the Java language and its API. We can type any valid Java code into the console and get immediate results without the need to write a verbose class with the main() method. C:\Users\User>jshell | Welcome to JShell -- Version ... Read More