Home » Core Java

Core Java

Selenium Chromedriver Tutorial

selenium-logo

 1. Introduction In this example set, we will be exhibiting the concept of Data Driven Testing (DDT) by passing multiple sets of data using Apache POI and Web driver interface of Chrome Driver and thus testing them on the Facebook URL. In this tutorial, we will be passing multiple sets of username and password from spreadsheet “Testdata.xls” to Facebook URL. ...

Read More »

Lombok Utility and Scrapbook an eclipse feature

eclipse-logo

Today we are going to see couple of utility features which could ease coding and help you save some time. They have handy features and I would recommend to have a look and try it. Let’s start a utility called Lombok which is an open source and helps to make code clean and reduce the boiler plate code. It’s very easy ...

Read More »

Java Nio Write File Example

java-logo

With this example we are going to demonstrate how to use the Non-blocking I/O API, or NIO.2 API (NIO API) for short, to write data to a file. The examples in this article are compiled and run in a Mac OS unix environment. Please note that Java SE 8 is required to run the code in this article. 1. Introduction to ...

Read More »

Java 8 Anonymous Function Example

java-logo

1. Introduction Java is an object Oriented Programming Language, and as such concepts like Encapsulation and Abstraction sits at the heart of it. However, since Java is a bit-too-much Object Oriented at its genome structure, that often times than not, it adds a lot of verbosity and boiler plate to its language constructs. Even simple, trivial requirement of creating an ...

Read More »

JAVA ActionEvent Example

java-logo

1. Introduction An Action can be used to separate functionality and state from a component. For example, if you have two or more components that perform the same function, consider using an Action object to implement the function. An Action object is an action listener that provides not only action-event handling, but also centralized handling of the state of action-event-firing ...

Read More »

Mockito Mock Database Connection Example

mockito-logo

A unit test should test a class in isolation. Side effects from other classes or the system should be eliminated if possible. Mockito lets you write beautiful tests with a clean & simple API. In this example we will learn how to write a simple test case using Mockito. Tools and technologies used in this example are Java 1.8, Eclipse ...

Read More »

Java 8 Array to Stream Example

java-logo

1. Introduction Official javadoc of java.util.stream.Stream states that it is “A sequence of elements supporting sequential and parallel aggregate operations”. And such every Stream is backed by a source which would provide the Stream with its “sequence of elements”. In Java, like most other programming languages, sequence of elements is generally provided via two constructs: (i) the java.util.Collection instances and ...

Read More »

Java Nio Read File Example

java-logo

With this example we are going to demonstrate how to use the Non-blocking I/O API, or NIO.2 API (NIO API) for short, to read the contents of a file. The examples in this article are compiled and run in a Mac OS unix environment. Please note that Java SE 8 is required to run the code in this article. 1. Introduction ...

Read More »

Mockito List Matcher Example

mockito-logo

In the Mockito Tutorial for Beginners, we saw a general overview of the use of Mockito framework for Java unit tests. In this example,we will see how are and how to use the Mockito Matchers for List elements. For this example, we will use: Java 1.7.0 Eclipse Mars 2, release 4.5.2. JUnit 4. Mockito 1.10.19. Tip You may skip project ...

Read More »

Mockito Test Case Example

mockito-logo

A unit test should test a class in isolation. Side effects from other classes or the system should be eliminated if possible. Mockito lets you write beautiful tests with a clean & simple API. In this example we will learn how to write a simple test case using Mockito. Tools and technologies used in this example are Java 1.8, Eclipse ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns