Presentation is loading. Please wait.

Presentation is loading. Please wait.

Session-01. Objective In this session you will learn : The Java Technology Phenomenon What is Java? What is Programming Language? What about Java Platform.

Similar presentations


Presentation on theme: "Session-01. Objective In this session you will learn : The Java Technology Phenomenon What is Java? What is Programming Language? What about Java Platform."— Presentation transcript:

1 Session-01

2 Objective In this session you will learn : The Java Technology Phenomenon What is Java? What is Programming Language? What about Java Platform ? What is File extension of Java? What about java Compiler? What Can Java Technology Do? Overview of Java History of Java & Java Version History JDK, JRE & JVM Main() Method & Command line arguments

3 The Java Technology Phenomenon Talk about Java technology seems to be everywhere, but what exactly is it?

4 Java Java is a programming language and a platform. Programming Language Platform

5 What is Programming Language?

6 Programming Language A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behaviour of a machine or to express algorithms. Say Hello Error

7

8 Continue... Say Hello 10101 Hello Compiler Interpreter

9 Programming Languages

10 Platform A platform is an underlying computer system on which application programs can run.

11 What about Java Platform ? A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. software-only platform The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.

12 Continue... cross platform Java is cross platform in the sense that a compiled Java program runs on all platforms for which there exists a JVM. (This holds for all major operating systems, including Windows, Mac OS and Linux.).jar file can be distributed and executed on Windows systems, Mac systems, etc. Java byte code won't need to be recompiled when you switch platforms. C and C++ will require that the developer recompile the application before distributing it to the target system, But once that's done clients will be able to run without an issue.

13 How to create cross platform application? Write your application in Java (In.java files) Compile your application using Eclipse or javac (into.class files) (Optionally) Bundle your.class files in an executable (.jar file)

14 What is File extension of Java?.java.java is for the source code..class when source code gets compiled then generate.class file. LanguageExtension C.c C++.CPP ASP.asp C#.cs PHP.php Java.java

15 What about java Compiler? Each language has own Compiler. In Java, programs are not compiled into executable files like c, c++ etc... They are compiled into Bytecode, which the JVM then executes at runtime. javac Java source code is compiled into bytecode when we use the javac compiler..class The bytecode gets saved on the disk with the file extension.class. When the program is to be run, the bytecode is converted, using the Just-In-Time (JIT) compiler. The result is machine code which is then fed to the memory and is executed. So Java has two step compilation: To create byte-code To create machine level code

16 Continue...

17 Java compilers Note: The GNU General Public License (GNU GPL or GPL) is the most widely used free software license, which guarantees end users (individuals, organizations, companies) the freedoms to use, study, share (copy), and modify the software.

18 Example

19 What Can Java Technology Do? According to Sun, 3 billion devices run java. There are many devices where java is currently used. Some of them are as follows:

20 How Will Java Technology Change My Life? Get started quickly Write less code Write better code Develop programs more quickly Avoid platform dependencies Write once, run anywhere Distribute software more easily

21 Types of Java Applications Standalone Application Web Application Enterprise Application Mobile Application

22 Overview of Java Java divided into three categories, they are

23 J2SE

24 J2EE

25 J2ME

26 Evolution of Programming Languages

27 History of Java James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun engineers called Green Team. Originally designed for small, embedded systems in electronic appliances like set-top boxes. Firstly, it was called "Greentalk" by James Gosling and file extension was.gt. After that, it was called Oak and was developed as a part of the Green project. Why Oak? Oak is a symbol of strength and choosen as a national tree of many countries like U.S.A., France, Germany, Romania etc. In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies.

28 Why they choosed java name for java language? The team gathered to choose a new name. The suggested words were "dynamic", "revolutionary", "Silk", "jolt", "DNA" etc. They wanted something that reflected the essence of the technology: revolutionary, dynamic, lively, cool, unique, and easy to spell and fun to say. According to James Gosling "Java was one of the top choices along with Silk". Since java was so unique, most of the team members preferred java. Java is an island of Indonesia where first coffee was produced (called java coffee). Notice that Java is just a name not an acronym. Originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995. In 1995, Time magazine called Java one of the Ten Best Products of 1995. JDK 1.0 released in(January 23, 1996).

29 Java Version History

30 Java Platform Standard Edition 7

31 JDK JDK is an acronym for Java Development Kit. It physically exists. It contains JRE + development tools. lib BIN JRE JDK

32

33 JRE JRE is an acronym for Java Runtime Environment. It is used to provide runtime environment. It is the implementation of JVM. It physically exists. It contains set of libraries + other files that JVM uses at runtime. lib BIN JVM JRE Other Files

34 JVM JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent. The JVM performs following main tasks: 1.Loads code 2.Verifies code 3.Executes code 4.Provides runtime environment

35 Basic Structure-1

36 Basic Structure-2

37 JVM provides definitions for the: Memory area Class file format Register set Garbage-collected heap Fatal error reporting etc.

38 Internal Architecture -1

39 Internal Architecture -2 For Java, JVM also contains heap and stack in runtime data area. Objects and arrays are created on heap, method frames are pushed to stack. One heap is shared by all threads, while each thread has its own stack.

40 Internal Architecture -3 runtime physical memory of a process. mostly threads just map to OS threads, at which point they get their own stack, same as any thread on the OS.

41 Example-1

42 Main() Method main() method is starting execution block of a java program or any java program start their execution from main method. If any class contain main() method known as main class.

43 Understanding first java program System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later.

44 How many ways can we write Main Method

45 To write the simple program in Notepad

46 Open Command Prompt

47 In Command Prompt To compile:javac Simple.java To execute:java Simple

48 Command line arguments If any input value is passed through command prompt at the time of running of program is known as command line argument by default every command line argument will be treated as string value and those are stored in string array of main() method.

49 Example of command-line argument in java

50 Summary!!


Download ppt "Session-01. Objective In this session you will learn : The Java Technology Phenomenon What is Java? What is Programming Language? What about Java Platform."

Similar presentations


Ads by Google