Sie sind auf Seite 1von 11

Software for Mobile Devices

Introduction to Java Programming Part (1)


Lecture # 2

Online Group Piazza: https://piazza.com/fast_lahore/fall2018/cs440/home


Access Code: cs440
History of Java (Oak->Green->Java)

• Java is a programming language created by James Gosling from


Sun Microsystems (Sun) in 1991.
• Created the concept of Virtual Machine.
• The target of Java is to write a program once and then run this
program on multiple operating systems.
• First publicly available version of Java (Java 1.0)
was released in 1995
• In 2006 Sun started to make Java available under the GNU
General Public License (GPL)

• Platform Independent.
Java Platform Overview
1. Java programming language (OOP, derived from
C).
Platform
Independent 2. Java compiler (compiler checks your code
against the language's syntax rules – makes
bytecode)

3. The Java Virtual Machine (JVM) (At runtime, the


JVM reads and interprets .class files and executes
the program's instructions)
JDK vs JRE
• Java Development Kit (JDK) (Compiler, Libraries)
It's the full featured Software Development Kit for Java,
including JRE, and the compilers and tools (like JavaDoc,
and Java Debugger) to create and compile programs.

• The Java Run time Environment (JRE) – JVM, Core libraries


It is basically the Java Virtual Machine where your Java
programs run on. It also includes browser plugins for Applet
execution.
Code to Deployment
Concepts
1. Access Modifiers
2. Inheritance
3. Polymorphism (Overloading, Overriding, static,dynamic binding)
4. Exception Handling (try, catch, finally)
5. Abstract classes/methods and interfaces
6. Static, final method/variables/classes
7. Packages
8. Collections and Data structures.
9. Garbage Collection
Access Modifiers

If you make any class


constructor private, you The default modifier is more
The scope of class A and its restrictive than protected.
cannot create the instance of
method msg() is default so it That is why there is compile
that class from outside the
cannot be accessed from time error.
class.
outside the package.
Inheritance

Single Inheritance
Hierarchical Inheritance Multi Level Inheritance
Inheritance

NO Multiple/Hybrid Inheritance through class in JAVA!!!


Polymorphism – Overloading/Static Binding

Same data type but different arguments Change data types of arguments
Polymorphism – Overriding/dynamic
binding

The binding of overloaded methods is static and the


binding of overridden methods is dynamic.

Same method name with same data type argument and # of


argument, calls method on runtime depending upon the
object type.

Das könnte Ihnen auch gefallen