Skip to content

Instantly share code, notes, and snippets.

View HaradaKumiko's full-sized avatar
🎯
Focusing

Farhan Rivaldy HaradaKumiko

🎯
Focusing
View GitHub Profile
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));
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;
class Coffee {
late String _temperature;
void panas() { _temperature = 'dingin'; }
void dingin() { _temperature = 'panas'; }
String serve() => 'Kopi ' + _temperature;
}
main() {
void main() {
int? nullValue;
int zeroValue, nonZeroValue;
zeroValue = 0;
nonZeroValue = 5;
// nullValue = 6;
print(hitung(nullValue, nonZeroValue));
}
<?php
Class Route{
protected $controller = 'HomeController';
protected $method = 'index';
protected $params = [];
public function __construct(){
if(isset($_GET['url'])){
String pesanOrder() {
var order = prosesOrder();
return 'Pesananan anda... $order';
}
Future<String> prosesOrder() => Future.delayed(
const Duration(seconds: 2),
() => 'Large Latte',
);
Future<void> prosesOrder() {
return Future.delayed(
const Duration(seconds: 2),
() => print('Large Latte'),
);
}
void main() {
prosesOrder();
print('Mengambil order...');
Future<String> pesanOrder() async {
var order = await prosesOrder();
return 'Pesananan anda... $order';
}
Future<String> prosesOrder() => Future.delayed(
const Duration(seconds: 2),
() => 'Large Latte',
);
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}`)
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}`)