Java Installation and OOP Basics

 Installing Java:

Some helpful tips for installing Java. Use https://www.oracle.com/java/technologies/downloads/

to install the Java software and get started. This link provides a tutorial to help guide you along the Java installation process. https://docs.oracle.com/javase/tutorial/index.html

You will also need an IDE (Integrated Development Environment) before you can start coding. This is essentially where you write the program. I use Visual Studio Code, it is very beginner friendly and allows for extensions to make coding much quicker and easier. https://code.visualstudio.com/download

Hello World!

One of the first programs most programmers create when learning a new language is the "Hello World" program. It is a simple program that simply prints "Hello World!". Since every language is different, the Hello World program allows new learners of a language to see how the same program looks in different programming languages. For example, in Python it looks like: print("Hello, World!"). In Java, however, it is:

public class HelloWorld {

    public static void main(String[] args) {

        System.out.println("Hello, World");

    }

}

Object Oriented Programming (OOP)

Object-oriented programming focuses on organizing software into objects that represent items in the real world. The 4 principles of OOP are what allow software developers to do this. 

They are:

  • Encapsulation
  • Inheritance
  • Polymorphism
  • Abstraction
Encapsulation keeps data and the methods that operate on that data together in a Class. Classes make the program easier to work with and maintain.

Inheritance allows for classes to use the properties of another class. For example, a vehicle class has set attributes, and a car class can use those same attributes while adding more to them.

Polymorphism allows the same method name to do different actions based on which object is using it. 

Abstraction simplifies complicated systems and shows only what is necessary to the developer. 

Comments

Popular Posts

Operating Systems Theory and Design Final

Post #7 E-commerce Sites

Post #4 Travelling Through a Network