What is Java?
Java is used by the top 95% of all employers worldwide to build mission-critical systems. Because of this demand, Java is widely embraced by the education community. Amongst its many features, Java is object-oriented, is written once and runs on any device, has built-in multi-threaded programming, an integrated UI library, and a rich ecosystem maintained by developers worldwide. For this and many other reasons, Java continues to attract educators. Java continues to evolve to meet the growing industry trends. (JavaCommunityProcess, n.d.).How to get started with Java
An easy way to start with Java is to get an IDE suitable for using the language. As a suggestion, visit https://www.eclipse.org/downloads/ and download the most suitable package for your device. Once the IDE is downloaded, you can run the setup file from the folder it is downloaded to (in Windows, downloads typically go to the downloads folder). Once the setup is done, run the application! When it starts, it will offer a few quick “cheat sheets” that are tutorials for setting up some beginner programs, such as printing out “Hello World!” Suppose you do not have a book or resource dedicated to instructing beginners in Java (or any language). In that case, I have also used stackoverflow.com, Geeksforgeeks.com, and tutorialspoint.com to get help from other experienced programmers. I often turn to one of these forums if the leading resource for learning a language becomes confusing or a program will not compile or run as expected. There is no shortage of programmers willing to exchange information on the Internet. It is advantageous to remain humble, use your favorite search engine (such as Google or Yahoo), and search for any question about your programming. Programming can be very challenging, but it does not have to be impossible.Getting Used to Terminology
Class & Object – What’s the difference?
With object-oriented programs (OOP), it is essential to know a few terms. To illustrate through example, I will use a common Legend of Zelda enemy known as the Moblin. The term class and the term object are similar. They can both have a state and a method. The state refers to attributes such as height, color, strength, and defense. In comparison, the method relates to an action such as running, walking, jumping, or attacking. The class will refer to the Moblin in general. It can have any states or methods listed in the original class. The object is then the implemented class, where the state and methods can be altered from how they were defined in the class. When an object is used in an application, it is considered an “instance of the class of objects known as [Moblins]. A class is a blueprint from which individual objects are created” (Oracle, 2015, Section: What Is a Class?)Inheritance – Not a blessing from a passed loved one (but close).
Inheritance is another common term that allows a class to extend to a superclass. Consider a Moblin that is purple and carries a club for the attack (we will specify this as a Purple Moblin) and a Moblin that is red, a bit larger, and wields an axe (we will specify this as a Red Moblin). The original class of Moblin might not have the state that defines the weapon, but it does have color and height. The superclass can then inherit all of the attributes for a Moblin, allowing new states or methods such as the weapon type and how the weapon is used, respectively (swing, jab, etc.). So, while this is not similar to receiving dear Uncle Jim’s priceless pea coat, it is similar to genetic similarities between families – some of the characteristics are repeated, and some are different.Interface – How actions for a class are enforced.
Interfaces are methods by which an object must be considered an “x.” In this blog, that is a Moblin. “No VARIABLES are allowed to be declared by the interface. An interface is about actions that are allowed, not data or implementation of those actions” (Germain, n.d., Section: Interfaces in Object Oriented). “An interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class)” ” (Germain, n.d., Section: Interfaces in Object Oriented).Package – As much as I love them, these are not the items delivered by internet shopping.
A package is a namespace (an abstract container or environment created to hold a logical grouping of unique identifiers) used to group common classes and interfaces (Oracle, 2015, Section: What is a Package?). In Java, packages are readily available for the programmer, including classes and interfaces common in programming, known as Application Programming Interfaces or APIs.
Four Principles of Object-Oriented Programming: Encapsulation, abstraction, inheritance, and Polymorphism
Encapsulation involves accessors and mutators, which can inquire about or alter the states and methods of a class. Encapsulation is then the protection of these accessors and mutators from the rest of the program so that they do not get changed unintentionally. “In a nutshell, encapsulation is the hiding of data implementation by restricting access to accessors and mutators” (Raymondlewallen, 2005, Section: Encapsulation). Abstraction is similar to interfacing in that it breaks down an object into parts without which it would not be. Inheritance, we discussed briefly, is the characteristic (state or method) that objects share. Polymorphism Polymorphism is one name, and it has many forms (Raymondlewallen, 2005, Section: Polymorphism). Relating to OOP, it is like the Moblin class, from which the objects Red Moblin and Purple Moblin are created. They share some states and methods, but not all. This principle intertwines with interfacing, inheritance, and abstraction.References
Germain, J. (n.d.) Interfaces. School of Computing University of Utah. https://users.cs.utah.edu/~germain/PPS/Topics/interfaces.html#:~:text=An%20interface%20is%20a%20programming,on%20an%20object%20(class).
JavaCommunityProcess. (n.d.) Java in education. https://www.jcp.org/java-in-education
Oracle. (2015). The Java tutorials: Lesson: Object-oriented programming concepts. Retrieved from http://docs.oracle.com/javase/tutorial/java/concepts/index.html
Raymondlewallen. (2005, July 19). 4 major principles of object-oriented programming [Blog post]. World Documents. https://vdocuments.net/4-major-principles-of-object.html

Comments
Post a Comment