Top Banner
By Samraiz Tejani Pawan Patil Vivek Khodade
24
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Java (1)

By Samraiz TejaniPawan Patil

Vivek Khodade

Page 2: Java (1)

How And Why Java?How we got java?

• Java was created by a team led by James Gosling for Sun Microsystems, James Gosling, Mike Sheridan, initiated the Java language project in June 1991. Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time.

Page 3: Java (1)

• The language was initially called Oak after an oak tree that stood outside Gosling's office; it went by the name Green later, and was later renamed Java, from Java coffee, said to be consumed in large quantities by the language's creators. However, when Java 1.0 was released to the public in 1996, its main focus had shifted to use on the Internet.java language derives much of its syntax from c and c++ but has a simpler object model and fewer low-level facilities.

Page 4: Java (1)

• Java is a fully functional, platform independent, programming language it has powerful set of machine independent libraries, including windowing (GUI) libraries. Java applications are typically compiled to byte code (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture.

• The most interested thing about java is "write once, run anywhere" (WORA), meaning the code that runs on one platform does not need to be recompiled to run on another.

Page 5: Java (1)

Why java ?

• One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java byte code, instead of directly to platform-specific machine code.

• Java byte code instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications..

Page 6: Java (1)

The History of Java TechnologySince 1995, Java has changed our world . . . and our expectations..

Today, with technology such a part of our daily lives, we take it for granted that we can be connected and access applications and content anywhere, anytime. Because of Java, we expect digital devices to be smarter, more functional, and way more entertaining.

In the early 90s, extending the power of network computing to the activities of everyday life was a radical vision. In 1991, a small group of Sun engineers called the "Green Team" believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java.

The Green Team demonstrated their new language with an interactive, handheld home-entertainment controller that was originally targeted at the digital cable television industry. Unfortunately, the concept was much too advanced for the them at the time. But it was just right for the Internet, which was just starting to take off. In 1995, the team announced that the Netscape Navigator Internet browser would incorporate Java technology.

Today, Java not only permeates the Internet, but also is the invisible force behind many of the applications and devices that power our day-to-day lives. From mobile phones to handheld devices, games and navigation systems to e-business solutions, Java is everywhere!

Page 7: Java (1)

Characteristics of Java

• Java is simple

• Java is object-oriented

• Java is distributed

• Java is interpreted

• Java is robust

• Java is architecture-neutral

• Java is portable

• Java’s performance

• Java is multithreaded

• Java is dynamic

• Java is secure

Page 8: Java (1)

Pros• Free.• The syntax is familiar to the programmers that know any other C based language.• Java (the platform) has a very large and standard class library, some parts of which are very well

written.• Automatic Memory Management implemented by Garbage Collection• Explicit Interfaces• Improving performance• Good portability (certainly better than that of nearly any compiled alternative)• Simplified syntax (compared to C++)• Lots of available code and third-party libraries

Page 9: Java (1)

Cons

• Performance: Java can be perceived as significantly slower and more memory-consuming than natively compiled languages such as C or C++.

• Look and feel: The default look and feel of GUI applications written in Java using the Swing toolkit is very different from native applications. It is possible to specify a different look and feel through the pluggable look and feel system of Swing.

• Single-paradigm language: Java is predominantly a single-paradigm language. However, with the addition of static imports in Java 5.0 the procedural paradigm is better accommodated than in earlier versions of Java.

Page 10: Java (1)
Page 11: Java (1)

How is Java different from C

C Language:

• Major difference is that C is a structure oriented language and Java is an object oriented language and has mechanism to define classes and objects.

• Java does not support an explicit pointer type• Java does not have preprocessor, so we cant use #define, #include and #ifdef

statements.• Java does not include structures and union data types.• Java does not include keywords like goto, sizeof and typedef.• Java adds labeled break and continue statements.• Java adds many features required for object oriented programming.

Page 12: Java (1)

How is Java different from C++…

C++ language

• Features removed in java:• Java doesn’t support pointers to avoid unauthorized access of memory locations.• Java does not include structures and union data types.• Java does not support operator over loading.• Preprocessor plays less important role in C++ and so eliminated entirely in java.• Java does not perform automatic type conversions that result in loss of precision.

Page 13: Java (1)

How is Java different from .NETJAVA

• Platform Independent•Programs written in Java runs on any OS.•Java is free and there are many third party good open source free IDEs for development of java applications.•Java is best choice for OSS (open choice software) development.•Development is comparatively slower.•Java applications development can be done on even less configuration computer system.•Java can only communicate with java programs

.NET

• Programs written in .NET runs on Windows only• .NET framework is also free but its official development IDE (Microsoft Visual Studio) is paid.• Due to Microsoft Visual Studio, development is faster.• Microsoft Visual Studio installation requires higher configuration system.• .NET is the platform itself for a multitude of languages. One can use C, C++ and VB to program upon .NET.

These programs interact with each other using common methods. these common methods are defined by .NET, and are used by the programs to communicate with each other without worry about that language the program was written in. the machine running the program/s will need the .NET platform to be installed.

Page 14: Java (1)

Java is architecture-neutral

JAVA Program Execution

Page 15: Java (1)

WORA(Write Once Run Anywhere)

Page 16: Java (1)

Editplus for Java Programming

Edit Plus Software:

• EditPlus is a 32-bit text editor for the Microsoft Windows operating system.

• The editor contains tools for programmers, including syntax highlighting (and support for custom syntax files), file type conversions, line ending conversion (between Linux, Windows and Mac styles), regular expressions for search-and-replace, spell check etc).

Page 17: Java (1)
Page 18: Java (1)

Just a Small Program In JAVA

Page 19: Java (1)

Execution of Hello world! Program

Page 20: Java (1)

Facts that Every Java Programmer Must Know

These are in no particular order, but these are things that all Java programmers should probably know.

• Who Invented Java, and when? James Gosling, at Sun Labs, around 1991; the group was building a set-top box and started by "cleaning up" C++ and wound up with a new language and runtime.

• What does Java stand for? Java is not a new unique word. The language was first named Oak, after the tree outside James' window so they called it Oak. One day this gang went out to the local cafe to discuss names and came up naming it Java.

• What is the JLS? JLS is The Java Language Specification. Every developer should buy or download (free) this specification and read it, a bit at a time.

• How do changes get into Java? JCP (Java Community Process).

• Why is there no printf-like function in Java? Actually there are! This was fixed in Java 5; see Java Cookbook (2nd Edition) Chapter 9. Java 5 (J2SE 1.5) includes printf (and scanf), String.format(), and lots more.

Page 21: Java (1)

Interesting!!

Can you guess what is the output of this statement in Java?

System.out.println(1+2+” = “+1+2);

3=12

Why? Apparently Java starts treating everything as a String once it has encountered a string in System out statement

Page 22: Java (1)

Conclusion

• A general-purpose object-oriented language.

• Write Once Run Anywhere (WORA).

• Designed for easy Web/Internet applications.

• Widespread acceptance.

• Portability and security necessitated the invention of Java

Page 23: Java (1)
Page 24: Java (1)