Before you can start your coding creativity, you must equip your computer with the right tools. A Java programmer needs a specific software environment. Java is free to download and use, making it accessible to everyone. The cornerstone of this environment is the Java Development Kit (JDK). This program bundle includes everything you need to write, compile, and run Java programs. You might come across another term, the Java Runtime Environment (JRE). While the JRE is necessary to run Java applications, the JDK is what you need to build them. So, for Java developers, the JDK is the software required. Download JDK from the Oracle website.
After installing the JDK, you can start writing Java code using a simple text editor like Notepad. However, professional developers rarely do this. Why? A good integrated development environment (IDE) like Eclipse dramatically streamlines the coding process. It provides features like code completion, error highlighting, and debugging tools, making your life as a coder much easier. You can download the Eclipse Desktop IDE package here.
This video provides step-by-step instructions on downloading and installing Eclipse on your machine.
Once you have installed Java, you should know Oriented Object Programming, a basic Java language concept.
Object-Oriented Programming (OOP) is a programming paradigm that organizes code around "objects" – self-contained units of data (attributes) and the actions (methods) that can be performed on that data. These objects are modeled after real-world entities, making conceptualizing and designing software easier. For example, In OOP, you could create a class called "Car". This class would define the properties of a car, such as its make, model, color, and current speed. It would also define methods allowing the vehicle to accelerate, brake, and turn. Each car in your game would be an instance (or object) of the Car class. You could create multiple car objects with different properties and behaviors, making your game world more realistic and interactive. (Gillis, 2021)
Basic definitions
Class is a blueprint or template that defines the properties (attributes/data) and behaviors (methods/functions) an object of that type will possess. (Oracle Java documentation, n.d. -a)
Object is a concrete representation of the class's blueprint, with specific values for its attributes and the ability to perform actions defined by its methods. (Oracle Java documentation, n.d.-b)
The four concepts of Oriented Object Programming
Encapsulation:
is a mechanism that bundles data and methods together within a class, protecting the data from being accessed or modified directly from outside the class, which promotes data integrity and modularity. (Stemmler, 2022)
Polymorphism
is the ability of objects of different classes to be treated as objects of a common superclass that allows flexibility and extensibility in code. (Stemmler, 2022)
Inheritance
is a mechanism where a new class called the child or subclass is created from an existing class called the parent or superclass. The child class inherits the properties and behaviors of the parent class, promoting code reusability. (Oracle Java documentation, 2019)
Abstraction:
Simplifying complex reality by modeling classes based on essential properties and behaviors. It's like focusing on the critical features of a car (steering wheel, pedals, engine) rather than the intricate details of its internal workings. (Stemmler, 2022)
References
Gillis, A. (2021, July). What is object-oriented programming (OOP)? (S. Lewis, Ed.). TechTarget. https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP
Oracle Java documentation. (n.d.-b). What is an object? (The javaTM tutorials > learning the java language > object-oriented programming concepts). Docs.oracle.com. https://docs.oracle.com/javase/tutorial/java/concepts/object.html
Oracle Java documentation. (2019). What Is Inheritance? (The JavaTM Tutorials >
Learning the Java Language > Object-Oriented Programming Concepts). Oracle.com. https://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html
Stemmler, K. (2022, May 31). 4 principles of object-oriented programming | khalil stemmler. Khalilstemmler.com. https://khalilstemmler.com/articles/object-oriented/programming/4-principles/