This file contains 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 FactorialRecursive { | |
public static void main(String[] args) { | |
Long angka; | |
Scanner inputan = new Scanner(System.in); | |
System.out.println("Masukan Angka : "); | |
angka = inputan.nextLong(); | |
System.out.println("Factorial dari " + angka + " adalah " + factorRecursive(angka)); |
This file contains 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 HitungFactorial { | |
public static void main(String[] args) { | |
boolean repeat = true; | |
Scanner input = new Scanner(System.in); | |
Scanner jawaban = new Scanner(System.in); | |
Long angka; | |
String jawab; |
This file contains 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
class Coffee { | |
late String _temperature; | |
void panas() { _temperature = 'dingin'; } | |
void dingin() { _temperature = 'panas'; } | |
String serve() => 'Kopi ' + _temperature; | |
} | |
main() { |
This file contains 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
void main() { | |
int? nullValue; | |
int zeroValue, nonZeroValue; | |
zeroValue = 0; | |
nonZeroValue = 5; | |
// nullValue = 6; | |
print(hitung(nullValue, nonZeroValue)); | |
} |
This file contains 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
<?php | |
Class Route{ | |
protected $controller = 'HomeController'; | |
protected $method = 'index'; | |
protected $params = []; | |
public function __construct(){ | |
if(isset($_GET['url'])){ |
This file contains 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
String pesanOrder() { | |
var order = prosesOrder(); | |
return 'Pesananan anda... $order'; | |
} | |
Future<String> prosesOrder() => Future.delayed( | |
const Duration(seconds: 2), | |
() => 'Large Latte', | |
); |
This file contains 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
Future<void> prosesOrder() { | |
return Future.delayed( | |
const Duration(seconds: 2), | |
() => print('Large Latte'), | |
); | |
} | |
void main() { | |
prosesOrder(); | |
print('Mengambil order...'); |
This file contains 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
Future<String> pesanOrder() async { | |
var order = await prosesOrder(); | |
return 'Pesananan anda... $order'; | |
} | |
Future<String> prosesOrder() => Future.delayed( | |
const Duration(seconds: 2), | |
() => 'Large Latte', | |
); |
This file contains 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
const smallArray = [5, 3, 2, 35, 2]; | |
const bigArray = [5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2]; | |
const start = performance.now() | |
smallArray.push(10) | |
const end = performance.now() | |
console.log(`Time : ${end-start}`) |
This file contains 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
const smallArray = [5, 3, 2, 35, 2]; | |
const bigArray = [5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2, 5, 3, 2, 35, 2]; | |
const start = performance.now() | |
bigArray.push(10) | |
const end = performance.now() | |
console.log(`Time : ${end-start}`) |
OlderNewer