Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning Plan 6 Java Programming Intro to Object Oriented Programming.

Similar presentations


Presentation on theme: "Learning Plan 6 Java Programming Intro to Object Oriented Programming."— Presentation transcript:

1 Learning Plan 6 Java Programming Intro to Object Oriented Programming

2 Object Oriented Programming (OOP) Up until this point, all of our programs contained one class (Furniture, Admissions, etc.) For example: public class HelloWorld { public static void main(String[] args) { System.out.println(“HelloWorld”); }

3 public class HelloWorld { public static void main(String[] args) { System.out.println(“HelloWorld”); } Our programs contained one class Each class (or each program) contained a main method We are now going to start adding additional classes to our programs Our programs will contain more than one class Only one of the classes will contain a ‘main’ method …. The rest do not.

4 Object Oriented Programming We are going to explore the OOP concept We’ve already been using it OOP allows for reusability of code – Why reinvent the wheel? Consider the following code:

5 Object-Oriented Programming (OOP) JOptionPane.showInputDialog(null, “Enter Name”): We’ve used this code frequently There is a file called JOptionPane.java that has been written and compiled for us (it became JOptionPane.class) Every time we wanted to ask the user for input, we REUSED the code from the JOptionPane class

6 Object Oriented Programming Start with Head First Java book Might jump around slightly Basic OOP Concepts and more advanced concepts – We will discuss & use basic concepts in depth – We will discuss and analyze advanced OOP concepts but use more of the concepts in other courses.

7 OOP Basic concepts include: – Classes, objects, methods, instance variables/properties, arguments, parameters, instantiation, encapsulation Advanced Concepts: – Inheritance superclass/subclass, overriding methods, polymorphism, abstract classes, interfaces Chapter 1 – read 2-3; 8-17

8 Before you start – Page 2 talks about the Java Virtual Machine (JVM) Java is a “write once, run anywhere” programming language. – Allows programs to run on multiple devices – Page 3 shows you that to compile a program, you execute the ‘javac’ command and to run it you start the JVM and execute the ‘java’ command Textpad does this automatically for us!!


Download ppt "Learning Plan 6 Java Programming Intro to Object Oriented Programming."

Similar presentations


Ads by Google