Skip to content

Instantly share code, notes, and snippets.

public class Desk {
Shape parts[];
public Desk() {
super();
this.parts = new Shape[4];
}
public void addShape(Shape shape) {
for (int i = 0; i < parts.length; i++) {
@OlexiyNasikovsky
OlexiyNasikovsky / Main.java
Created August 11, 2016 14:18
TriangleProj
package TriangleProj;
public class Main {
public static void main(String []args) {
Triangle t1 = new Triangle(3.2, 2.3, 4.1);
Triangle t2 = new Triangle(5.2, 2.3, 3.4);
Triangle t3 = new Triangle(7.4, 9.1, 2.5);
Triangle t4 = new Triangle(3.7, 2.2, 4.6);
System.out.println(t1.findArea() + "\n");
@OlexiyNasikovsky
OlexiyNasikovsky / Cat.java
Last active August 11, 2016 14:20
CatProj
package CatProj;
public class Cat {
private String name;
private double weight;
private String colour;
private double speedOfEating;
private int age;
public Cat(String name, double weight, String colour, double speedOfEating, int age) {
@OlexiyNasikovsky
OlexiyNasikovsky / Main.java
Last active August 11, 2016 14:09
PhoneProj
package PhoneProj;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Phone phone1 = new Phone(311111111l);
Phone phone2 = new Phone(322222222l);
Phone phone3 = new Phone(333333333l);
@OlexiyNasikovsky
OlexiyNasikovsky / 0_reuse_code.js
Created February 21, 2016 14:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console