Category: 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 :

    How […]

    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

  • 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

  • JAVA to support determining the week of the year.

    Java to support determining week year Some applications, in their business logic, deal with the number of weeks in a year and the current week of the year. There are 52 weeks in a year, but 52 weeks multiplied by 7 days per week equals 364 days per year, not the actual 365 days. A week number is used […]

    Posted in: Java

  • JAVA & .NET which is the best

    Which is the best JAVA or.NET To know that which is the best JAVA or .NET following pros of both technology will help you. Pros for Java: Java EE has better OR-support than .NET. JPA (Java Persistence API), Hibernate etc. .NET comes with Entity Framework, but it isn’t as lean as JPA. In .NET land […]

    Posted in: Java

  • Graphics Class in Java

     Graphics Class in Java Guys you can draw lines, shapes, characters, and images to the screen inside  your applet. Most of the graphics operations in Java are methods defined in the Graphics class. You don’t have to create an instance of Graphics in order to draw something in your applet; in your applet’s paint() method , you are […]

    Posted in: Java

  • Use of the volatile variable in java

    Volatile in Java First, you have to understand a little something about the Java memory model.The best way I can think of to describe it is if you imagine it this way pointed as below : Each thread in Java takes place in a separate memory space (this is clearly untrue, so bear with me […]

    Posted in: Java

  • Lambda Expressions in Java

    Java is a first-class object-oriented language. With the exception of primitive data types, everything in Java is an object. Even an array is an Object. Every class creates instances that are objects. There is no way of defining just a function / method which stays in Java all by itself. There is no way of […]

    Posted in: Java