|
You are here |
imalittletester.com | ||
| | | | |
www.jamesward.com
|
|
| | | | | ||
| | | | |
componenthouse.com
|
|
| | | | | I wanted tocompare how Java, C++ and C perform whenreading a text file line by line and printing the output. I've implemented some possibilities and, at the end, we can compare the speed of each execution. Java 7 version (BufferedReader) import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main7 { private static final... | |
| | | | |
mydeveloperplanet.com
|
|
| | | | | This blog introduces Cucumber, a tool for Behavior-Driven Development (BDD) in Java applications. It covers the project setup using Maven, writing scenarios in GWT notation, implementing application logic, step definitions, adding extra scenarios, using tags, and generating reports. It shows how Cucumber integrates with JUnit and Assertions in Java. | |
| | | | |
konradreiche.com
|
|
| | | Since most of the Java code I wrote in the past was on Android I was not able to enjoy too many Java 8 features yet. Though recently I wrote a microservice in Java using Spring Boot where I could make full use of lambdas and functional interfaces. The following method, for instance, returns the sum of all transactions for a specified instance by traversing their children. @RequestMapping(value = "/transaction/sum/{id}", method = RequestMethod.GET) BigDecimal Sum sum(@PathVariable long id) { List transactions = new ArrayList<>(); Transaction current = repository.find(id); while (current != null) { transactions.add(current); current = current.getChild(); } return transactions.stream().map(t -> t.getAmount()) .reduce(BigDecimal.ZERO, BigDecimal::add); } As some... | ||