Principles of Java

The Java programming language has been developed over the years following very strict principles.

The five principles of Java as declared when Java was created include, first,

that it's a simple, object- oriented, and familiar language.Its simplicity lies greatly in its consistency.Once you learn how to do one thing in Java, you know how to do it the same way throughout the language because it never deviates from the way thelanguage is architected.

It's an object-oriented language.
So once you understand the principles of encapsulation, inheritance, and
polymorphism and how those are implemented in the Java programming language,you'll have a much better sense of how to architect your applications.
And for developers who've worked with C-Style languages like C and C++, the
syntax of Java is very familiar.

Java was created to be robust and secure.
Its robustness lies greatly in its object-oriented characteristics, because you're designing everything as an object, everything has methods or functions
and properties also known as fields.And you create applications by combining multiple classes together.This lets you create your code in small chunks and it makes it easy to debug and maintain your applications over time.


Java was designed to be portable, so that you'd be able to compile it once and
then run your application on multiple operating systems and processors.


Java was created to be high-performance.
The original version of the Java Virtual Machine wasn't as fast as C++
applications, but over the years it's been improved enormously, and today Java applications run just as fast or sometimes even faster than applications built in C++.


And finally Java was created as an interpreted language, it supports multithreading and it's dynamic.Interpreted, means that the application is compiled to a format that's interpreted at runtime rather than being run as machine code directly, this is what makes the applications portable.


It's multithreaded, and it makes it easy to build applications that do more than
one thing at the same time.
And it's dynamic, in that it can change data types at runtime as long as those
data types are compatible with each other.

The principles can be summarize as:

principles of Java


Here is the runtime architecture of Java.

Runtime Architecture of Java


Again, it's an interpreted language, the application is compiled to
bytecode rather than machine language, and that's what makes it portable
between operating systems.


Here is the software stat that's used at runtime when you run your application.
You start with the operating system.


You can run Java applications on Windows, Mac, Linux, Solaris, and any other
operating system for which there is a usable Java Virtual Machine.
The Java Virtual Machine you use most of the time will be the one provided by
Oracle, the one that was created by Sun Microsystems, but there are other JVMs out there provided by IBM, the Virtual Machine that's provided for Android by Google and many others.


On top of the Virtual Machine you add the core runtime and additional libraries.
The core runtime is sometimes called the Java Class Library, and it consists of
all of the functionality that's provided with the core Java developer toolkit.And finally your application runs on top of all that once again as compiled bytecode.

So let's compare Java to a couple of popular languages.
First C++, Java was originally created by C++ developers and they had in mind
improving the developers' lot.
Here are some ways in which Java is different from C++.

Javs Vs C


If you're a C developer all of your code can be run in C++ as well.The two languages are compatible with each other, that's not true for Java.
Even though Java has syntax that's very similar to C and C++, its code is unique. It has its own rules and its own syntax.


I have mentioned earlier that C++ is compiled to native machine language and
while that makes it very fast and gives it access to low-level functions, it means that your application has to be recompiled for each operating system and
processor that you want to target.Java is compiled to bytecode.Because C++ is compiled to native machine language, it allows direct calls to the native system.
In Java there is an interface called Java Native Interface sometimes called JNI,that lets you call those native functions through the JVM.


C++ lets you write once and then as long as you followed standard C++ syntax you can recompile for each operating system you are targeting, whereas the principles of Java say that you can write once and run anywhere.
Java runs in a protected virtual machine environment, and again, you have to go through that JNI interface to make those low-level system function calls.Here's a way in which the two languages are very different.C++ requires explicit memory management and uses pointers.C++ applications as a result can have memory leaks and it's up to the developer to make sure that they've sealed up all the holes in their application.


In Java, memory is managed for you.
When you create instances of classes or objects, the Java Virtual Machine automatically allocates the memory. And when you're done with the objects the JVM sweeps up the memory by destroying dereferenced objects, this is called the Garbage Collector.This means that in Java applications you don't have to know specifically how much memory is being used at any given time, you still have to pay attention to making sure that you only create the objects you need.


And in C++ you can use multiple inheritance, this means that when you define an object you can inherit functionality for multiple super classes.

The Java inheritance model is single inheritance so you can only inherit directly from a single superclass.


This makes it easier to figure out where there are problems when your
application has bugs.Let's also compare Java to JavaScript.
Even though the names of these languages share the term Java, they are really
not closely related.Java again wasn't compatible with previous languages even though it borrowed syntax from C.

Java has morphed into a standard known as ECMAScript or ECMAScript.Other languages that are based on the ECMAScript standard include

Adobe'sActionScript 3.0 and JScript from Microsoft and a number of others.Java is compiled to bytecode and interpreted at runtime.

java compared to javaScript

JavaScript is interpreted directly from source code.
Java can make native function calls through the JNI interface, while inJavaScript at least as it's implemented in a browser, is restricted to something
called a browser Sandbox.It can only play in the Sandbox, and it can't make native function calls.


Java is write once, run anywhere.JavaScript is even more portable in the sense that it has brought compatibility in many browsers and many operating systems.Java runs in a protected virtual machine but you have to explicitly have that virtual machine installed.And in a similar fashion JavaScript is executed by the browser and restricted to that browser sandbox for security.
Both languages manage the memory for you, neither requires that you specifically allocate or deallocate memory.


And in terms of inheritance, Java uses a traditional class-based inheritance
where you define classes and then inherit their functionality.
JavaScript uses something called prototype-based inheritance.
This model allows you to add functions, properties, and other functionality to a pre-defined class at runtime, something Java doesn't allow you to do.
So that's a look at the principles of Java and how you might compare this
language to C++ and JavaScript.


In the continuum of languages you might play C++ at the strictest level, Java
somewhere in the middle, and JavaScript at the most dynamic.
And you typically use Java when you want to build applications that rely on that language.

The Java programming language has a long history. It started in 1991 when Sun Microsystem began something called “The Green Project”. The goal of the Green project was to create a new portable programming language. One that could be used to create applications that could run on multiple operating system. The original name of the language was “Oak” for a large Oak tree that stood outside the windows of the developers offices. But between the time the project began and the time the language was released it was renamed as java supposedly because the amount of the coffee the developers were drinking.

 

Java was first released to the public in 1995 and thereafter saw rapid evolution in change . Starting in 1995 the phrase “Write Once, Run Anywhere” was popularized. Again the code of Java was that you will be able to write a program, you will be able to compile once and be able to run on Unix, on Windows, on Mac, and other operating systems for which there was a java Virtual machine.

Java evolved swiftly . In the early years there was a new release about once a year. In 1996 sun released the first complete Java developers kit or JDK supporting a broad range of application development task. Version 1.1 the following year saw improvements to the object oriented nature of the java with inter-classes and java beans. The JDBC API for talking to databases, RMI or remote method invocation for distributed systems and reflection for improving the dynamic capabilities of the language.

In 1998 Java was rebranded as J2SE or java two standard edition. The standard edition distinguished from the enterprise edition which was the frame work for building large scale web applications. the version number was Java2 version 1.2, a little confusing and the two after the day stuck around for many many years but the versions were incremented using point numbers.

J2SE 1.2 included the Swing graphical API for building desktop applications, the collections framework for managing multiple data elements and new tools including the Just in Time compiler and the Java plugin which standardized the version of java across web-browsers.

A couple of years later J2SE 1.3 added new tools including the hotspot JVM, a new version of the java virtual machine. The Java Sound API improved and debugging capabilities.

In 2002 version 1.4 added new tools in the language and then in 2004 a major new release came around. That was J2SE 5.0. This version was known both as 1.5 and 5.0 but subsequent new releases would jus used the major numbers so it would become 5, 6, 7 and so on. J2SE 5 was a major new change for the language. A new feature called generics was implemented  that let you strongly datatype  collection elements, enumerations, variable arguments and looping with for-each was all improved. And in term of language syntax this was really the last major change to the language. Every thing since then has been nibbling around the edges.

In 2006 java6 came out . It improved performance for database connectivity, improved graphical programming and they added other smaller features in the language and then the pace of change slowed. From 2006 to 2010 Sun Microsystem released occasional maintenances releases to the language so you would have Java6 maintenance release 10 , 12 and so on and now the maintenance version have moved to version 29 with the main Java version java6.

History of Java

 

Then in 2010 a major event occurred . Oracle bought Sun . Sun Microsystems and all of its assets including the java programming language became the part of the Oracle. Oracle company started managing Java along with JCP the Java community process that sun began . In 2011 J2SE 7 was released. It included minor changes to the language such as strings in switch, try-catch improvements, Simplified variable arguments and underscores in numeric literals and some other small scale tools and were expecting another version of java down the road possibly known as J2SE8 and it would include many things that would differ from J2SE7 including something called lambda expressions or closures. If you don’t know what those are, You needn't be worry about that since they are not part of Java Language now.

Java has been around since 1995 and has been used in lot of programming environment.

.

History of Java Programming Language

 

 

 

 

 

 

 

 

 

The history of Java programming language can be summarized in the given timeline above.

Hi, everybody. This is your tutor for this course “Java Tutorial for Beginners”. The aim of this course is to develop the concept of Java Programming Language to solve real life problems. Without wasting more time let us look at a quick glance to the outcomes after you complete this course successfully. In this course we will aim to learn these topics in full details so that your Java Programming Skills will be enhanced.Java is a must if you want to do one of the following tasks in normal, however there is a variety of possibilities where you can use your skills after learning java programming language. Some of these includes:

  • Designing or building applications for Android systems.
  • Designing web applications which are dynamic to be used on those servers which use Java enterprise edition.
  • Designing applets which can be run or delivered via web-browsers.

 

After finishing this course, you will be able  to do following things:

  1. You will learn to download and install the Java Development Kit on your system depending upon whether it is Windows or MAC.
  2. You will also learn about “Eclipse” provided by the Eclipse foundation which is a free cross platform IDE among many others IDE required for java programmers.
  3. You will also learn about data types, keywords and good-practices involved in programming which sums up the basic of every programming languages along with Java.
  4. You will know about the specialties of object oriented programming language like Java and be able to use terms like inheritance, encapsulation and polymorphism to use the idea for better programming.
  5. And last but not the least you will get yourself started with the basics ending in the skills that can help you to solve real life problems and design or build several desktop, mobile and web-applications.

And it is obviously for those students who find themselves hard getting into the concept of Java in schools and colleges.

So, without wasting more time lets get ourselves ready for this course.

 

IS THIS THE RIGHT COURSE FOR YOU

Although the course is already named as“Java Tutorial for Beginners” and is intended for  those people who want to learn from the basics of Java programming, some of you might be still thinking if this is the appropriate course for you or not.

Here are few Questions you should be sure off before starting this course. Go through it thoroughly  and you will find the answer whether this course is really for you or not.

 

What “JAVA” is?

Before getting into the questions like “Whether this course is right for me or not” , you should first be sure of the type of software you are intending to program or develop. Java can be used to program various applications for Blackberry and Android phones as well as for various tablets. Java is also used to create web-based dynamic applications that is possible with the help of programming modules such as java server pages also known as servlets. Along with all these, java is used to program or develop variety of other applications we will discuss later on.

java tutorial

 

What “JAVA” is not?

Java is not JavaScript and you should not be confused with the term Java and JavaScript from now on. Unlike Java, JavaScript is a Server-side Programming or more correctly server side scripting language which is used to create dynamic applications and is incorporated within the web-browsers itself, normally in the modern browsers. It runs on client-side however, meaning the effect is seen on user’s browsers.The task of executing the code is done by the browser itself. It is true that both share the word called “Java” but you should know that these two languages are very different from each other.They however have some similarities in their syntax and appearance but still their working style internally and their uses are totally different. So if you are aiming or searching courses for developing web pages in which the browsers execute your code, then JavaScript is the language you are looking for.

Java free tutorial

You should know that Java is not used to develop applications for I-phones and I-pad i.e. native IOs applications. Applications for IOs are developed using Objective C programming language using the IDE called the X-code. Also Java is not used to program applications for the phones which run windows OS or simply Windows phone. Applications for Windows-phone are developed or programmed using either VB.net, C sharp (C#) or Visual studio environment.

Do not develop the misconcept that java is the easiest programming language in the world. To be frank, it is not because it is one of the compiled language and it has specific and very strict data-typing rules of its own. Since Java is totally Object-oriented programming language, you should learn or know about the concepts involved with “Object-Oriented Programming”. However this is the main aim of this course as well so you need not worry too much if you are foreign to these terms.

It is true that java is not the easiest programming language in the world but bear in mind that it is also true that it is not the hardest programming language in the world. It is among those languages which has very consistent rules and regulations and once you grab the concept of this language and start thinking in term of this language you are able to extend your abilities very quickly being capable of using many tools.

So who is the right person or audience for this course?

free java tutorial

The truth about this course is that it is designed for everybody who want to learn the Java programming language and want to develop applications or software using this language. It is also for the students who are struggling with the concepts of this programming in their colleges or schools.But however it is specifically intended to those who have basic knowledge of some programming language and understands the basic vocabulary of programming. Software developers or programmers have their own sets of vocabulary comprising of programming terms they all understand. However the meanings of these terms too vary from language to language but it doesn't create larger problems since programmers can communicate and discuss wit each other easily.

This course is designed for anybody who want to build software using java Programming language. But specifically this course is designed for those who already have basic programming vocabulary. Software developers as with many trades have their own unique vocabulary incorporating terms that they all understand. Many of these terms have different meanings from one programming language to another but programmers can always talk with each other.

Let us see whether you are familiar with these terms or not. Here is a quick test:

 ARE YOU FAMILIAR WITH THESR TERMS. CAN YOU ANSWER THEM?

Do not think that I m just starting “ Java” and how come before that I can answers these questions. You shouldn't answer these questions according to the relations with Java, Jus try to answer them in any term, in form of any programming language.

  • Tell something about statements?
  • Tell something about variables?
  • Tell something about  functions?
  • Tell something about conditions?

If the above questions and the terms included in these questions seems odd to you and you have never used them before, I suggest you to learn the course  “Pre-requisites for programming” first but if you insist to move on and learn these terms with practice you can still be in but it will take little time before you become able to know these terms completely. This course “Pre-requisites for programming” explains you the above terms and also help you to be familiar with their uses in programming language including Java as well. Then after you will be totally fit for this course.

If you have already used these terms and are familiar with them and if you have used or studied any programming language before, you will realize that some programming languages help you more then other programming languages. Programming language like C, C++, C#, JavaScript and even PHP share similar syntax and appearance with Java. The knowledge of these languages if you have any will prove to be very helpful to recognize Java.

Also if you are from C or C++ background you will see that java is like C. This is true because Java is a C-style language meaning the basic syntax and appearance of both languages and even some more languages are same.

However if you have done programming but not the ones mentioned above like Vb.net, visual basic,Cold fusion or some assembly language then there will be no problem because you just need the concept of the above mentioned terms.Rest is all upon this course which will teach you the Java syntax, using Java syntax, java variables, functions, statements, looping, conditional logics and a lot.

online java tutorial

If you have done some programming and you are not new to the terms of the above questions, you should be perfectly fit for this course.

Blogger Templates by Blog Forum