CPT307 Week 1 Interactive Assignment 02
Provide guidance on Java installation. provide a step-by-step tutorial on how to install Java. provide links to tutorials or resources that you may have used to install Java and produce the Hello World program.
How to Install Java Script!
Java installation is very simple by using this link (https://www.oracle.com/java/technologies/downloads/) once you are at the site there are several options you can choose from for Java. The best course of action is to download the most up to date version of Java, in this case Java SE Development Kit 19.0.1. Select the correct operating system from the options (Linux, macOS, or Windows) and click the link labeled with Installer. If installing on Windows select the x64 Installer, once downloaded follow the installer guide.
Eventhough you have installed Java, you will need an environment to use Javascript in. I am using a program called Apache NetBeans 15 which is free to download (https://netbeans.apache.org//). Using the link provided you can down load Netbeans to write Javascript
Discuss the concepts and features of object-oriented design principles.
Object-oriented design is based on several concepts that interconnect to each other within a simple program. These beginning concepts consist of objects, classes, and interfaces. The foundation of these three concepts makes way for the four main principles of OOPs known as Encapsulation, Data Abstraction, Polymorphism, and Inheritance. The main focus of the OOPs is to bind all these concepts together with data and functions that operate in cohesion.
THE FOUNDATION
Class
First is a class, a class is a blueprint or prototype from which objects are created. This is the foundation to all programming within Java and using classes the user can creat multiple objects with the same behavior. Using a human as an example if the user needs mutiple humans in the program and they all need to be walking the class can be defined as walking and all humans within that class will behave in the same manner. The saves time in that the data does not need to be rewritten for the same behavior. The class body is defined by using surrounding brackets, {}.
Object
The second of these concepts is an object which is a model of a real-world object. Objects can be considered anything physical in the non digital world that the programmer wants to turn digital. An object has two different characteristics, a state and behavior, that can be converted from the real world to the digital world. The state of an object is the physical being of the object for example a human has a name, skin tone, and emotions. The behavior of the object is the actions the object can take for example walking, laughing, or eating.
Interface
Then there is the interface which is the connection between a class or object prototype and the outside world (nondigital world). An example of interface is the power button on your computer, it allows the user to turn the computer on or off. Keeping with the example of a human the interface would be the changes that the class would take. This could be the speed of travel (walking, jogging, running) or talking cadence (whisper, normal talking, shouting).
BRINGING IT TOGETHER: FOUR MAIN PRINCIPALS
Encapsulation
Encapsulation is when data is essentially hidden. With the example of humans, the name of a person might want to be kept hidden so the name of the person would be encapsulated to keep the data hidden. Other information that a human to keep hidden is Personally Identifiable Information or PII.
Data Abstraction
Data abstraction focuses on the representation for an actual item and the development of a software object to represent an object from the real world (Raymondlewallen, 2005). This is used to handle the complexity of an object and simplifies it to use similar data.
Polymorphism
Polymorphism in data is the same as its definition which is one name, many forms. There are many humans in the world of all types and they all share this one same name. Yet though humans share the name “human” they take on many forms and purposes.
Inheritance
Next is inheritance which provides a powerful mechanism for organizing and structuring software. Inheritance allows Java classes to reuse the methods and fields of the class. All objects have a base or commonality (humans) but can have different characteristics (skin tone, height, proportions). Inheritance allows these objects to “inherit” the commonly used states or behaviors from other classes.
References:
Raymondlewallen. (2005, July 19). 4 major principles of object-oriented programming [Blog post]. World Documents. https://vdocuments.net/4-major-principles-of-object.html
https://docs.oracle.com/javase/tutorial/java/concepts/index.html
https://www.youtube.com/watch?v=CWYv7xlKydw
Comments
Post a Comment