• How to Deal if Java has slow Input and output classes

    Just because of Java has slow Input and output classes suggested by many people for competitive programming As following explain some ways to get over the trouble and change the conclusion from TLE to (in most cases) AC. For all the Programs below Input: 6 6 11 73 89 858 99986 Output: 4 Scanner Class […]

    Posted in: Java

  • How to deal with NullPointerException in Java

    NullPointerException in Java According to the detail mentioned in JavaDocs  below points covered for nullpointerexception in java: Thrown when an application struggle to use null in a case where an object is required. These include: Calling the instance method of a null object. Accessing or modifying the field of a null object. Taking the length of […]

    Posted in: Java

  • sorted array faster than an unsorted array-Thatsjavainfo

    why sorted array faster than an unsorted array?Here is a Java code which shows that sorting the stored array amazingly makes the code faster than the unsorted array. Let’s try out a below piece of JAVA code to find out the its better.

    Output :

    examine that time taken for processing a sorted […]

    Posted in: Java

  • flatMap with example in Java 8

    flatMap with example in Java 8: To know flatMap with example in Java 8 . please go for below steps. Stream can hold different data types In Java 8 like below example:

      But, the Collectors and Stream operations (distinct,filter, sum,…) do not support it, so, we need flatMap() to do the following conversion :

    […]

    Posted in: Java

  • Optional Class in Java 8

    Optional Class in Java 8: Introduced a new Optional class in java 8 ( java.util package). this class is used to represent a value is present or absent. The main advantage of this new construct is that No more too many null checks and NullPointerException. By using this we can avoids any runtime NullPointerExceptions which help us to […]

    Posted in: Java

  • Java 8 Example to filter a Map

    Java 8 Example to filter a Map Here we are going to learn that how to filter a map in java 8 Stream API. -An example to know that how it was without Java 8

    -In Java 8  Map.entrySet() can be convert in to a stream, follow by a filter() and collect() as below example.

    […]

    Posted in: Java

  • SMTP Mail Through Java with Example

    SMTP Mail Through Java with Example Two mail through java with example are here to show you how to use JavaMail API method to send an email via Gmail SMTP server, using both TLS and SSL connection. below details are required for sending an email.

    To run this example, you need two libraries – […]

    Posted in: Java

  • Create a Database in MySQL

    There are two ways to create a database in MySQL 1) By executing a simple SQL query 2) By using forward engineering in MySQL Workbench In this tutorial we will learn both of the ways to create the database in MySQL. Create a Database by query method: Lets imagine we need to create a database with name […]

    Posted in: Database

  • ALGEBRA(Join) In RDBMS(RELATIONAL DATABASE MANAGEMENT SYSTEM)

    ALGEBRA In RELATIONAL DATABASE MANAGEMENT SYSTEM Relational Algebra Operators are mathematical functions used to retrieve queries by describing a sequence operations on tables or even databases(schema) involved. With relational algebra operators, a query is always composed of a number of operators, which each in turn are composed of relations as variables and return an individual abstraction […]

    Posted in: Database

  • All new features of java 8

    All new features java 8 Look at the below list to know the all new features java 8 A)Change in Language: 1.Lambda Expressions|Functional Programming Lambda expressions provide anonymous function types to Java – Replace use of anonymous inner classes – Provide more functional style of programming in Java

    2.Extension Methods|Bringing Multiple Inheritance (of Functionality) to […]

    Posted in: Java