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.github.rxrav.java21bootcamp; | |
public class JavaRocks { | |
private final int times; | |
private boolean shouldPrintJava = true; | |
public JavaRocks(int times) { | |
this.times = times; | |
} | |
public synchronized void printJava(Runnable action) throws InterruptedException { |
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 main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func sayHello() { | |
for i := 0; i <= 100; i++ { | |
fmt.Println("Hello", 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 main | |
import "fmt" | |
var cache = make(map[int]int) | |
var dCounter int | |
func fibDyn(n int) int { | |
dCounter++ | |
if _, ok := cache[n]; !ok { |
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 main | |
import "fmt" | |
var rCounter int | |
func fibRec(i int) int { | |
rCounter++ | |
if i == 1 { | |
return 0 |