Schlagwörter » Java

Polymorphism 2

Casting Objects

Once we changed a reference type, though, we lost access to more specifi c methods defi ned in the subclass that still exist within the object.  509 weitere Wörter

1Z0-808 Note: Chapter 1: Java Building Blocks -Object Reference and Primitives

Java applications contain two types of data: primitive types and references type. Let’s see the difference between these two data type.

Primitive Type

Java has eight built-in data type, which we called is primitive type. 797 weitere Wörter


cli4clj 1.2.5 - Improved Testability of Multi-threaded Command Line Applications in Clojure

In my previous post, I already outlined the problem of testing multi-threaded interactive command line interfaces (CLIs). In the meantime, I came up with some improvements for addressing the testability of multi-threaded command line applications with… 1.048 weitere Wörter

Open Source

Area of Rectangle program

For my second tutorial  I am going to code a calculation to find the area of a rectangle. This time I am going to ask the user to input values to participate in the program. 430 weitere Wörter


How to create File in vert.x

Pretty much everything in vert.x works in Async manner and same applies to I/O operations. Let us quickly jump to the code.

package com.sample.codingfactory;

import io.vertx.core.Vertx;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;

public class FileCreation {
	private static final Logger logger = LoggerFactory.getLogger(FileCreation.class);

	public static void main(String[] args) {
		Vertx vertx = Vertx.vertx();
		vertx.fileSystem().createFile("/tmp/coding.txt", handler -> {
			if (handler.succeeded()) {"Successfully created file");
			} else {"Failure in creating file");



… 88 weitere Wörter
Creating File

REST Web Services in Java – Jersey

This is the last post of the three I’ve planned to publish about creating and exposing a REST web-service in Java. Previously, we made use of… 1.342 weitere Wörter


Mock HibernateTemplate with Mockito


Mockito is a useful Java library to create mock Objects for Java Unit Testing.

I used the framework Mockito in order to test objects difficult to test otherwise such as Struts method, Servlet, Hibernate , etc… 338 weitere Wörter

Non Classé