Chapter 1 - Introduction To Object-Oriented Programming
Chapter 1 - Introduction To Object-Oriented Programming
- Ermias N.
8, July 2021
Paradigm can also be termed as method to solve some problem or
do some task.
There are lots for programming language that are known but all of
them need to follow some strategy when they are implemented and
this methodology/strategy is paradigms.
Cont’d…
Disadvantage:
• Complex problem cannot be solved
• Less efficient and less productive
Cont’d…
• When you drive a car, pressing its gas pedal sends a message to the
car to perform a task— that is, to go faster.
• Similarly, you send messages to an object.
• Each message is implemented as a method call that tells a method of
the object to perform its task.
Attribute and Instance variables
• You can know how much gas is in your own gas tank, but not
how much is in the tanks of other cars.
• Objects may communicate with one another, but they’re
normally not allowed to know how other objects are
implemented
—implementation details are hidden within the
objects themselves.
Java and a Typical Java Development Environment
Phase 5: Execution
• The JVM executes the program’s bytecodes.
• JVMs typically execute bytecodes using a combination of
interpretation and so-called just-in-time (JIT) compilation.
• Analyzes the bytecodes as they’re interpreted
• A just-in-time (JIT) compiler—known as the Java HotSpot compiler—
translates the bytecodes into the underlying computer’s machine
language.
Cont’d…
• When the JVM encounters these compiled parts again, the faster
machine-language code executes.
• Java programs go through two compilation phases
• One in which source code is translated into bytecodes (for
portability across JVMs on different computer platforms) and
• A second in which, during execution, the bytecodes are translated
into machine language for the actual computer on which the
program executes.
QUIZ: