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.Random; | |
public class MethodsExamples { | |
public static void main(String[] args) { | |
int x = getRandomNumber(); | |
helloKitty(); | |
hello("Kitty"); | |
hello("Student"); | |
hello("Teacher"); |
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
public static void main(String[] args) { | |
int year = 1099; // -9999.....9999 | |
// range check | |
int date = 12; | |
String[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; | |
int month = 12; // -100 - +100 --> valid 1..12 | |
String monthStr = months[month - 1]; |
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.Random; | |
import java.util.Scanner; | |
public class Task02 { | |
public static void main(String[] args) { | |
Random rnd = new Random(); | |
int randomInt = rnd.nextInt(11); |
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.Random; | |
import java.util.Scanner; | |
public class GameWithTimer { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
Random rand = new Random(); |
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
#!/usr/bin/env node | |
console.log("Calculating first 100 prime numbers.\n") | |
var primes = []; | |
var findPrime = function(primes, check) { | |
for (i = 0; i < primes.length; i++) { | |
if (check % primes[i] == 0) { | |
return false; | |
} |
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
package lv.org.substance.crypt | |
import java.security.spec.AlgorithmParameterSpec; | |
import java.security.spec.KeySpec; | |
import javax.crypto.Cipher; | |
import javax.crypto.SecretKey; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.spec.PBEParameterSpec; |