Skip to content

Instantly share code, notes, and snippets.

View Yurlov's full-sized avatar

Yurlov Yurlov

View GitHub Profile
@Yurlov
Yurlov / Continent.java
Created July 22, 2016 23:06
prog.kiev.ua
package SolarSystem;
public class Continent {
private String name;
public Continent(String name) {
this.name = name;
}
package FileSystem;
public abstract class AbstractFSEntity implements FSEntity{
public String name;
public AbstractFSEntity(String name) {
this.name = name;
}
@Yurlov
Yurlov / Film.java
Last active July 23, 2016 00:08
Prog.kiev.ua
package EnumFilm;
import java.util.ArrayList;
import java.util.List;
public class Film {
private String name;
private int year;
@Yurlov
Yurlov / Pair.java
Last active July 22, 2016 21:43
Prog.kiev.ua
package GenericSample;
public final class Pair<L,R> {
public Pair(L left, R right) {
this.left = left;
this.right = right;
}
@Override
@Yurlov
Yurlov / Animals
Created June 30, 2016 22:25
Prog.kiev.ua
class Animals {
private String name;
private int age;
private String color;
public int getAge() {
return age;
}
public void setAge(int age) {
@Yurlov
Yurlov / Book
Created June 30, 2016 21:46
Prog.kiev.ua
public class Book {
private int id;
private String name;
private String author;
private int year;
private int pages;
private int price;
private String publishing;
private String bindingType;
@Yurlov
Yurlov / PalindromSample
Created June 30, 2016 20:47
Prog.kiev.ua
public class PalindromSample {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] myArray = new int[10];
arrayFiller(in, myArray);
getPalindromNumber(myArray);
}
private static boolean isPalindromNumber(int number) {
@Yurlov
Yurlov / Month
Created June 30, 2016 20:44
Prog.kiev.ua
public class MonthSample {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int month = getScan(in);
checkMonth(month);
getMonth(month);
in.close();
@Yurlov
Yurlov / Rectangle
Created June 30, 2016 20:42
Prog.kiev.ua
class Rectangle {
private int height;
private int weight;
Rectangle(int height, int weight) {
checkParameters(height, weight);
this.height = height;
this.weight = weight;
}
@Yurlov
Yurlov / FactorialCalculator
Created June 17, 2016 13:02
Prog.kiev.ua
public class FactorialCalculator {
public static void main(String[] args) {
factorial(15);
}
public static long factorial(long n) {
if (n < 1 || n > 20) {
throw new IllegalArgumentException("Sorry");
} else {
long factorial = 1;
for (int i = 1; i <= n; i++) {