1 / 25

The JAVA Language

Object Oriented Technology. The JAVA Language. Mithani Binjan M. Programming Languages. To adapt to changing environments and uses To implement refinements and improvements in the art of programming. History of OOPs. In 1960s Birth of Structured Programming Language

tosca
Download Presentation

The JAVA Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Oriented Technology The JAVA Language Mithani Binjan M

  2. Programming Languages • To adapt to • changing environments and uses • To implement • refinements and improvements • in the art of programming

  3. History of OOPs • In 1960s Birth of Structured Programming Language • In early 1980s object-oriented programming (OOP)

  4. History of OOPs • In 1979 C++ invented by Bjarne Stroustrup • 1980s and the early 1990s, C++ took hold.

  5. History of OOPs • In 1991 Java was conceived By James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan • At Sun Microsystems, Inc. “Oak”  “Java” (1995)

  6. Java the Language of Internet • Expanded the universe of objects • Objects can move about freely in cyberspace. • On a network : • passive information/data • dynamic, active programs

  7. Java Applications -&- Java Applets • An application is a program that runs on your computer, under the operating system of that computer. • An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser.

  8. Java’sMagic: The Bytecode • An application a highly optimized set of instructions designed to be executed by the Java run-time system - JVM • JVM - Java Virtual Machine • Truly Portable

  9. JVM • Interpreter • JVM needs to be implemented for each platform. • Platform independent • Bytecode enables the Java run-time system to execute programs much faster

  10. Just In Time (JIT) compiler • Sun supplies its Just In Time (JIT) compiler for bytecode. (Java-2) • JIT compiler is part of the JVM. • It compiles bytecode into executable code in real time, on a piece-by-piece, demand basis.

  11. Java Buzzwords • Multithreaded • Architecture-neutral • Interpreted • High performance • Distributed • Dynamic • Simple • Secure • Portable • Object-oriented • Robust

  12. Java Versions • Java 2, version 1.4 • Java 2, version 1.5 • Java 2, version 1.6 • Java 1.0 • Java 1.1 • Java 2 • Java 2, version 1.2 • Java 2, version 1.3

  13. Java the OOP Language • The Three OOP Principles • Encapsulation • Inheritance • Polymorphism • Abstraction

  14. Encapsulation A B getA() getB( )

  15. Inheritance Bird Flying Non-Flying Robin Swallow Penguin Kiwi

  16. Polymorphism Shape Draw( ) Draw( a, b ) Draw( a ) Draw( a, b, c ) Triangle Circle Rectangle

  17. Object Object : Student • Run time entity • Represent a PERSON, BOOK, • Bank Account, etc… • User defined data • Example: DATA: Roll_no Name Percentage FUNCTIONS: Total Average Display

  18. Class CLASS • Set of Data & Code is class • User defined data-type • Example: • Fruit, • Furniture • Vehicle DATA: ::::::::::::: ::::::::::::: FUNCTIONS: :::::::::::: ::::::::::::

  19. Variables & Data Types • Named memory location that holds a value • In java variables must be declared before it use in the program • Variable must be of some datatype, it tells compiler what type of value it can store

  20. Type Size in bytes Description Keyword Character 2 16-bit Unicode char Boolean - true / false 1-bit boolean Byte 1 8-bit byte Short 2 16-bit short Integer 4 32-bit int Long 8 64-bit long Float 4 32-bit float Double 8 64-bit double Data Types • Java supports eight different basic data types.

  21. Declaration &Initialization of variable Datatype varName; // Declaration of Variable varName = Value; Example: int count = 22;

  22. Declaration &Initialization of variable float x, y, z; // value here considers as ‘double’ type x = 10.35; x = 10.35f; y = 24.56F; z = y;

  23. Declaration &Initialization of variable long m = 254836L; System.out.println(“The value of m is “ + m); Output: The value of m is 254936

  24. Declaration &Initialization of variable Character & Strings char ch = ‘A’; String s1= “This is Testing”; //String is a class provide by Java.

  25. Guess the Output Class test { public static void main(String s[]) { char c; boolean flg; int a; System.out.println(c); System.out.println(flg); System.out.println(a); } }

More Related