Tutorials Point (Links to an external site.)Links to an external site.. (https://www.tutorialspoint.com/java/) - For this one, they assume you have the basic understanding of Java, which I did not at first, however I still continued to read and take in as much info as I could.
Oracle. (2015). Lesson: Object-oriented programming concepts (Links to an external site.)Links to an external site.. Retrieved from http://docs.oracle.com/javase/tutorial/java/concepts/index.html
Before you try to download one of the various application used for editing Java, you need to have Java installed on your PC. I'll save you the trouble, and post a link, to the ones Eclipse (the editor of DLE of my choice) will send you too if you forget to install Java first.
https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Once you are at the Oracle site listed above, you'll want to accept the license agreement and choose the right download for your system. I'm on Windows, so I choose Windows X64, and you want to make sure you install both 8u191 and 8u192, if you only have one, you will get an error redirecting you to download Java first. So it's important you have both installed.
Eclipse (Links to an external site.)Links to an external site.. (http://www.eclipse.org/)
- This application is awesome! I highly recommend this, as it not only as a walkthrough on how to create your first code of "Hello World", but it also goes over the basics of how to, why, and assists is helping you see your errors and how to fix them!
Now that you have Java, and an editor of your choice (like Eclipse) installed on your PC, we can start a new project. I suggest using the "Hello World" tutorial found when you open Eclipse to better understand how to. It's very easy to use the walk through, and you can also venture off while using it, to create you own. I used it in the screenshot below, to show you can vere off for their instruction, and try something different.
As you can see, I used the tutorial to assist me in an assignment for my class. The first project at the top, I deleted my source, therefor, my Java code did not work. a few other helpful getting started links:
https://docs.oracle.com/javase/tutorial/index.html
https://www.oracle.com/technetwork/java/javase/overview/index.html
https://www.javatpoint.com/java-oops-concepts
Java is a great programming language to start out with, as it is Object Oriented programing, and a lot easier to understand than say Python. With Object Oriented Programing (OOP), you are designing a program using objects and classes. If you tried out the tutorial above, you added a class to write out either "Hello world" or "Hello my name is..." as I did in the screenshot. "Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation" (https://www.javatpoint.com/java-oops-concepts)
An object can be anything physical or logical, it can be an animal, pen, bike, table or chair.
A class is a collection of objects - like household items. It can also be described as a blueprint.
An Inheritance is "When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism." (https://www.javatpoint.com/java-oops-concepts)
Polymorphism is when one task is performed in other ways. For example speaking, one person might speak English while 5 other people in the room speak 5 other languages.
Abstraction is "Hiding internal details and showing functionality is known as abstraction. For example phone call, we don't know the internal processing." (https://www.javatpoint.com/java-oops-concepts)
Encapsulation is forming code together in a single unit, thinking of it as binding together, wrapping it up in one package, or casing like a pill."What is encapsulation? Well, in a nutshell, encapsulation is the
hiding of data implementation by restricting access to accessors and
mutators. First, lets define accessors and mutators:
Accessor
An accessor is a method that is used to ask an object about itself. In
OOP, these are usually in the form of properties, which have, under
normal conditions, a get method, which is an accessor method.
However, accessor methods are not restricted to properties and can be
any public method that gives information about the state of the object." (http://codebetter.com/raymondlewallen/2005/07/19/4-major-principles-of-object-oriented-programming/) - Code Better is another excellent source to assist in Learning about Java and also understanding OOP.
Javatpoint has a great list of the three advantages to using OPP, with helpful Diagrams, I suggest checking out their full post, and reading it in it's entirety. Link posted above, but here is their diagram and the three advantages just in case you are like many, and don't like to click around until you finish your first resource.
Advantage of OOPs over Procedure-oriented programming language
1) OOPs makes development and maintenance easier whereas in a procedure-oriented programming language it is not easy to manage if code grows as project size increases.
2) OOPs provides data hiding whereas in a procedure-oriented programming language a global data can be accessed from anywhere.

Figure: Data Representation in Procedure-Oriented Programming

Figure: Data Representation in Object-Oriented Programming
3) OOPs provides the ability to simulate real-world event much more effectively. We can provide the solution of real word problem if we are using the Object-Oriented Programming language. (https://www.javatpoint.com/java-oops-concepts)
No comments:
Post a Comment