Essential Java
welcome to my tutorial of Java programing . In this tutorial i will cover as much Java programing as can be crammed into one tutorial- in depth and detail.I don't turn away from the more difficult issues because the aim of this tutorial in to lay out all Java for you , making it ready for use. If you're like me and have a few programming packages, you'll enjoy working with Java more than others, and I hope that you'll choose choose Java as your choice of programming platform.
All about Java
Where did Java come from ,and why is it so popular? Like other programming languages,
Java filled a specific need of its time. For example ,before Java appeared ,C was an extremely popular language with programmers, and it seemed that C was the perfect programming language combining the best elements of low-level assembly language and higher-level language into a programming language that fits into computer architecture well and that programmers liked.
However,C has its limitations like the earlier programming languages had before it. As programs grew longer , C programs became more unwieldy, because there was no easy way to cut up a long C program into self-contained compartments. This meant that code in the first line of a long program could interfere with code in the last line , and the programmer had to keep the whole code in the mind while programming.
To cut long programming semi-autonomous units ,object-oriented programming became popular. With object-oriented programming \, the motto is "divide and conquer".In other words, you can divide a program into easily conceptualized parts .For example, if you have a complex system that you use to keep food cold , you might watch the temperature of the food using a thermometer , and when the temperature gets high enough , you throw a switch to start the compressor to make the valves work so that the coolant circulates; then, you start a fan to blow air over the cooling vanes , and so on. That's one way to do it . However , another is to connect all those operations to make them automatic , wrapping the whole unit into an easily conceptualized unit - a refrigerator . Now all the internals are hidden from your view , and all you have to do is put food in it out of the refrigerator.
That's the way objects work: they hide the programming details from the rest of the program, reducing all the interdependencies that spring up in a long C program by setting up a well-defined and controllable interface that handle the connection between the object and the rest of the code .Now you can think of the object in an easy way- for example, you might have an object that handles all the interaction with the screen ,an object you call screen .You can use that object in ways you'll see throughout the tutorial to manipulate what it is intended to work on (in this case , the screen display). After creating the object ,you know that the screen is handled by that object and can put it out of your mind- no longer does every part of the code have to set up its own screen handling;you can just use the 'Screen' object.
Java Appears
Java was not originally created for the internet .The first version of Java appeared in 1991 and was written in 18 months at Sun Microsystems.In fact,it wasn't even called Java in those days; it was called Oak,and it was used internally at Sun .
Oak was renamed Java in 1995 ,when it was released for public consumption,and it was almost an immediate hit.By that time ,Java had adopted a model that made it perfect for the internet-the bytecode model.
All about Bytecode
Java itself is implemented as the Java Virtual Machine(JVM),which is the application that actually runs your Java programs.When JVM is installed on a computer ,it can run Java programs,therefore,don't need to be self-sufficient, and they don't have to include all the machine-level code that actually runs on the computer. Instead , Java programs are compiled into compact into compact bytecodes, and it's these bytecodes that the JVM reads and interprets to runs your program. When you download a Java applet on the internet, you're actually downloading a bytecode file.
In this way, your Java program can be very small,because all the machine-level code to run your program is already on the target computer and doesn't have to be downloaded. To host Java on a great variety of computer ,Sun only had to rewrite JVM to work on those computers.Because your program is stored in a bytecode file,it will run on any computer on which JVM is installed .
Although Java programs were originally supposed to be interpreted by the JVM-that is , executed bytecode by bytecode-interpretation can be slow process.for that reason,Java 2 introduces the Just In Time(JIT) compiler,which is built into machine language so the program can run faster(the Java whole program is not compiled at once because Java performs runtime checks on various sections of the code ). From your perspective, this means your Java programs will run faster with the new JIT compiler.
Java Security
When Java executes a program ,the JVM can strictly monitor what goes on,which makes it great for Internet applications. As you're already aware that security has become an extremely important issue on the Internet ,and Java rises to the task of taking care of the same.The JVM can watch all that a program does,and if it does something questionable,such as trying to write a file ,it can prevent that operation.
That alone makes Java more attractive than C++, which has no such restrictions , for the internet .
You can also tailor Java security the way you like like it ,which has offers a very flexible solution .
welcome to my tutorial of Java programing . In this tutorial i will cover as much Java programing as can be crammed into one tutorial- in depth and detail.I don't turn away from the more difficult issues because the aim of this tutorial in to lay out all Java for you , making it ready for use. If you're like me and have a few programming packages, you'll enjoy working with Java more than others, and I hope that you'll choose choose Java as your choice of programming platform.
All about Java
Where did Java come from ,and why is it so popular? Like other programming languages,
Java filled a specific need of its time. For example ,before Java appeared ,C was an extremely popular language with programmers, and it seemed that C was the perfect programming language combining the best elements of low-level assembly language and higher-level language into a programming language that fits into computer architecture well and that programmers liked.
However,C has its limitations like the earlier programming languages had before it. As programs grew longer , C programs became more unwieldy, because there was no easy way to cut up a long C program into self-contained compartments. This meant that code in the first line of a long program could interfere with code in the last line , and the programmer had to keep the whole code in the mind while programming.
To cut long programming semi-autonomous units ,object-oriented programming became popular. With object-oriented programming \, the motto is "divide and conquer".In other words, you can divide a program into easily conceptualized parts .For example, if you have a complex system that you use to keep food cold , you might watch the temperature of the food using a thermometer , and when the temperature gets high enough , you throw a switch to start the compressor to make the valves work so that the coolant circulates; then, you start a fan to blow air over the cooling vanes , and so on. That's one way to do it . However , another is to connect all those operations to make them automatic , wrapping the whole unit into an easily conceptualized unit - a refrigerator . Now all the internals are hidden from your view , and all you have to do is put food in it out of the refrigerator.
That's the way objects work: they hide the programming details from the rest of the program, reducing all the interdependencies that spring up in a long C program by setting up a well-defined and controllable interface that handle the connection between the object and the rest of the code .Now you can think of the object in an easy way- for example, you might have an object that handles all the interaction with the screen ,an object you call screen .You can use that object in ways you'll see throughout the tutorial to manipulate what it is intended to work on (in this case , the screen display). After creating the object ,you know that the screen is handled by that object and can put it out of your mind- no longer does every part of the code have to set up its own screen handling;you can just use the 'Screen' object.
Java Appears
Java was not originally created for the internet .The first version of Java appeared in 1991 and was written in 18 months at Sun Microsystems.In fact,it wasn't even called Java in those days; it was called Oak,and it was used internally at Sun .
Oak was renamed Java in 1995 ,when it was released for public consumption,and it was almost an immediate hit.By that time ,Java had adopted a model that made it perfect for the internet-the bytecode model.
All about Bytecode
Java itself is implemented as the Java Virtual Machine(JVM),which is the application that actually runs your Java programs.When JVM is installed on a computer ,it can run Java programs,therefore,don't need to be self-sufficient, and they don't have to include all the machine-level code that actually runs on the computer. Instead , Java programs are compiled into compact into compact bytecodes, and it's these bytecodes that the JVM reads and interprets to runs your program. When you download a Java applet on the internet, you're actually downloading a bytecode file.
In this way, your Java program can be very small,because all the machine-level code to run your program is already on the target computer and doesn't have to be downloaded. To host Java on a great variety of computer ,Sun only had to rewrite JVM to work on those computers.Because your program is stored in a bytecode file,it will run on any computer on which JVM is installed .
Although Java programs were originally supposed to be interpreted by the JVM-that is , executed bytecode by bytecode-interpretation can be slow process.for that reason,Java 2 introduces the Just In Time(JIT) compiler,which is built into machine language so the program can run faster(the Java whole program is not compiled at once because Java performs runtime checks on various sections of the code ). From your perspective, this means your Java programs will run faster with the new JIT compiler.
Java Security
When Java executes a program ,the JVM can strictly monitor what goes on,which makes it great for Internet applications. As you're already aware that security has become an extremely important issue on the Internet ,and Java rises to the task of taking care of the same.The JVM can watch all that a program does,and if it does something questionable,such as trying to write a file ,it can prevent that operation.
That alone makes Java more attractive than C++, which has no such restrictions , for the internet .
You can also tailor Java security the way you like like it ,which has offers a very flexible solution .
NICE BLOG!!! Thanks for sharing useful information about FNT Softwre Solutions and being one of best Software Training institute in Bangalore we agree that this blog is very useful for the students who are searching for best software courses, I would really like to come back again right here for like wise good articles or blog posts. Thanks for sharing...Java training company bangalore.
ReplyDelete