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 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++) { |
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 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"); |
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 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) { |
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 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); | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |