Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

User defined functions and the this keyword

Create new car (it's a contracter - also a methode)

Screenshot (168) Screenshot (169) Screenshot (170) Screenshot (171)

Create a another methode to change colour

Screenshot (172) Screenshot (173)

User input

Screenshot (175) Screenshot (176)

for other Data types

Screenshot (177)

go into Data Structures

Array

The main differents of array & string, the data type , Array can store same Data Types in a contanear.

Screenshot (178) Screenshot (179) Screenshot (181) Screenshot (182) Screenshot (183) Screenshot (184) Screenshot (185) Screenshot (186)

Because Array s are Referance type . so we use .toStrong Class otherWise we get a memory address.

call by Value Vs call by Referance

Screenshot (187) Screenshot (188) Screenshot (189) Screenshot (190) Screenshot (191) Screenshot (192) Screenshot (193) Screenshot (194)

play with String

Screenshot (197)

Chalange 01

Screenshot (198) Screenshot (199)
files
public class Dog {

    String name;
    int age;
    String[] fetchedItems = {"bone", "stick", "ball"};
    private int fetchCounter = 0;

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void bark() {
        System.out.println("Bark!");
    }

    public int getDogYears() {
        // Assume 1 dog year is 7 human years
        return this.age * 7;
    }

    public void fetch() {
        this.fetchCounter = (this.fetchCounter + 1) % 3;
        String item = this.fetchedItems[this.fetchCounter];
        System.out.println(name + " fetched a " + item + ".");
    }

}

controll the code flow with IF-else && Loops

📖 Libraries

Screenshot (324) Screenshot (326) Screenshot (328) Screenshot (327) Screenshot (329) Screenshot (330)

Deep dive --> OOPS

Screenshot (331) Screenshot (332) Screenshot (333) Screenshot (335) Screenshot (336) Screenshot (339) Screenshot (340) Screenshot (341) Screenshot (342)

Chapter 04 > 04_03 > begin

Screenshot (347)
Screenshot (348) Screenshot (349)
Screenshot (350) Screenshot (351) Screenshot (352)

Quize

Screenshot (353) Screenshot (354) Screenshot (355) Screenshot (356) Screenshot (357) Screenshot (358) Screenshot (359) Screenshot (360) Screenshot (361) Screenshot (362)