Skip to content

Instantly share code, notes, and snippets.

View coffeedriven's full-sized avatar

Maciej Dzikowicki coffeedriven

View GitHub Profile
package org.coffeedriven;
public class EqualsHashCodeExample {
public static void main(String[] args) {
String a = "Aa";
String b = "BB";
System.out.println("Equals: " + a.equals(b));
System.out.println("Hashcode a: " + a.hashCode());
package org.coffeedriven;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class StreamExample2 {
public static void main(String[] args) {
package org.coffeedriven;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class StreamExample {
public static void main(String[] args) {
List<Item> items = new ArrayList<Item>();
package org.coffeedriven;
import java.math.BigDecimal;
public class Item {
String name;
int weight;
BigDecimal price;