Creating CLASSES and OBJECTS in Java Tutorial
Zenva
ACCESS the FULL COURSE here: https://academy.zenva.com/product/java-foundations/?zva_src=youtube-androidmd
TRANSCRIPT
Now let’s put together everything we have learned in this final big topic. Objects are code entities with state and behaviour. The state is represented by variables that make up various properties or attributes. The behaviour is managed by functions that the object can run; typically, these functions modify the state in some way. Classes act as blueprints for objects, specifying what variables an object should use to make up its state and also defining any functions the object might want to run. We can then create instances of these classes which are the objects themselves. We can think of this a bit like function construction where the class is the function definition as it describes what the object can do and the object is like calling the function because we are actually running some code found within the class. Classes also use special constructor functions to create instances and set up the initial state of the object.
An example of this might be a character in a game. Some attributes that a generic character has might be name, health, position, attack, defence, etc. and a character might be able to heal, move, attack, etc. We will implement some of these attributes and behaviours.
Free resources: https://linktr.ee/zenva
Free Tutorials:
- Unity: https://gamedevacademy.org
- Phaser: https://phasertutorials.com
- Godot: https://godottutorials.pro
- Machine Learning: https://pythonmachinelearning.pro
- Web Dev: https://html5hive.org
- Android: https://androidkennel.org
- Swift: https://swiftludus.org
- VR: https://vrgamedevelopment.pro ... https://www.youtube.com/watch?v=3750awqJ7R4
29379657 Bytes