Download presentation
Presentation is loading. Please wait.
1
CIS 234: Object-Oriented Programming with Java
Dr. Ralph D. Westfall March, 2010
2
Overview what is programming? object-oriented programming
introduction to Java objects integrated development environment advantages and disadvantages
3
What is Programming? program = list of steps for a computer
like a recipe steps can be in different "languages" Java, Visual Basic, C++, Assembler, etc. how many languages? (one answer) each language has own syntax (rules) like grammars in human languages 175 as of 9/26/6
4
Why Is Programming Hard?
a computer is very "stupid" it doesn't understand anything: you have to tell it exactly what to do have to follow all the rules (syntax) of the language as you are telling it what to do it takes a lot of practice to be able to tell the computer exactly what to do, in perfect syntax ["Simon says:"]
5
Computer Language Types
low level vs. high level general purpose vs. special purpose procedural vs. object-oriented
6
Language Levels low level: machine language high level
language that a computer understands binary numbers e.g high level languages that people can understand words like "if," "else," "for," "true"
7
Translation convert high level languages into a computer's machine language compiled all source code in a file converted into an object code file, then executed all at once interpreted source code converted into machine language and executed, one line at a time
8
Translation - 2 some languages are both compiled and interpreted
1st compiled into "intermediate language" (like a machine language) Java is first compiled into "bytecode" by Java Virtual Machine (JVM; see diagram) Visual Basic.NET works like this also intermediate language is then interpreted/runs one line at a time
9
Special Purpose Languages
don't do everything do a few things very well example: markup languages HTML, XML display text, images, etc. not good for calculations
10
Procedural Languages one step after another
data and actions (procedures) are separated example: plans for a large wedding data = list of all food & supplies procedures = all instructions for every part of the wedding
11
Object-Oriented Languages
newer approach to programming data and procedures that use it are together in the same place (object) objects can operate independently event-driven programs instead of 1 step after another
12
Object-Oriented Languages - 2
encapsulation or "data hiding" can only access data through object's private procedures (send message to object) inheritance new objects extend capabilities of parents HourlyEmployee inherits all properties and methods of Employee object
13
Object-Oriented Advantages
real world (supposedly) is somewhat like objects employee, car, dog different objects can hook together like Lego blocks objects can be reused instead of "reinventing the wheel"
14
Java developed by Sun Microsystems an object-oriented language
"chopped down" from C/C++ similar syntax omits C features that cause crashes has added features not in C/C++ built-in networking capabilities make it work well with Internet
15
More About Java "cross-platform transparency"
not designed to only run well on certain computers/operating systems runs on any computer that has Java Virtual Machine (JVM) software one standardized version, not multiple versions of Java unlike multiple C & UNIX versions J# is similar, but it is NOT Java
16
Review Questions Computer programs are like ________?
A programming language syntax is like _______________? Why is computer programming hard? How are low level and high level computer languages different? How are compiled and interpreted computer languages different?
17
Review Questions - 2 How are general purpose languages different from special purpose ones? give examples of each How are procedural languages different from object oriented ones? What is inheritance? What is data hiding?
18
Review Questions - 3 Name some advantages of object oriented programming What company created Java? What is the Java Virtual Machine (JVM)? What is cross-platform transparency? How many different versions of Java are there?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.