π―
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ca.bazlur; | |
public class JavaRocksPrinter { | |
private final int times; | |
public JavaRocksPrinter(int times) { | |
this.times = times; | |
} | |
public void printJava(Runnable action) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ca.bazlur.concurrency101; | |
import java.util.Random; | |
import java.util.concurrent.CyclicBarrier; | |
import java.util.concurrent.TimeUnit; | |
import java.util.stream.IntStream; | |
public class CyclicBarrierDemo { | |
public static void main(String[] args) throws InterruptedException { | |
final int numberOfPortfolios = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ca.bazlur.concurrency101; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package spy; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.sound.sampled.*; | |
import java.io.*; | |
public class AudioRecorder { | |
private static final Logger LOGGER = LoggerFactory.getLogger(AudioRecorder.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.masterdevskills.stream; | |
import java.math.BigDecimal; | |
import java.util.List; | |
import java.util.function.Supplier; | |
import java.util.stream.IntStream; | |
public class Demo { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.masterdevskills.playground; | |
import java.util.List; | |
import java.util.function.Function; | |
public class BoxingExample { | |
public static void main(String[] args) { | |
long l = System.nanoTime(); | |
for (int i = 0; i < 10_000_000; i++) { | |
heavyLifting(i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jugbd.quiz; | |
import java.util.function.Function; | |
import java.util.stream.Stream; | |
import static org.jugbd.quiz.Coffee.CoffeeDecoratorUsingLambda.getCoffeeWithExtras; | |
@FunctionalInterface | |
public interface Coffee { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.masterdevskills.playground; | |
import java.io.File; | |
import java.time.LocalDate; | |
import java.util.*; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.function.UnaryOperator; | |
import java.util.stream.IntStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator { | |
public int add(int a, int b) { | |
return a + b; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scr = new Scanner(System.in); | |
Calculator calculator = new Calculator(); | |
System.out.println("Enter first input: "); | |
int a = scr.nextInt(); |
NewerOlder