Friday 21 December 2018

Google + Content reposting May 10 2015


Digital and Interactive Games 2015 – Term 2, Week 3, Session 1
For each style
・    1 dimension array
・    2 dimension array
Superclass reference
・    to access members
・    to initialise
・    to call method
Abstract
Final

Powershell
To check java version
'java -version'

Ninth Project

int Nums[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int sum = 0;
for (int i : Nums) {
    sum += I;
}

System.out.Println(sum);





Superclasses


Can't cast to a subclass


http://i483.photobucket.com/albums/rr193/Brenorenz/W11S001_zpsclfxqkyd.png



Call constructor
    super (______)
Listing 5


Listing 9

Each listing


Testfifteen
TwoDShape.java
public class TwoDShape {
    private double width;
    private double height;

    private string type;

    void showDim() {
        System.out.Println(“Width and height are ”  + getWidth() + “and ” + getHeight());
    }

    public double getWidth() {
        return widthl
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}



No comments:

Post a Comment