{"id":2063,"date":"2020-03-03T13:55:24","date_gmt":"2020-03-03T13:55:24","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=2063"},"modified":"2021-01-19T21:56:13","modified_gmt":"2021-01-19T16:26:13","slug":"what-is-java","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/what-is-java\/","title":{"rendered":"What is Java ? | Introduction"},"content":{"rendered":"<h2><b>Introduction to Java<\/b><\/h2>\n<ul>\n<li>What is java ? It is a programming language and platform for application development.<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It was first introduced by Sun Microsystem in 1995 and later obtained by Oracle Corporation.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Nowadays, Java has mostly used programming language.<\/span><\/li>\n<\/ul>\n<h2><b>About Java Platform<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It is a collection of programs that helps the user to develop and run applications that are written in <a href=\"https:\/\/www.h2kinfosys.com\/courses\/java-online-training-course-details\">Java programming language<\/a>.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It includes an execution engine, a compiler, and a set of libraries. Java is a platform-independent language.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Java is not particular to any processor or operating system.<\/span><\/li>\n<\/ul>\n<h2><b>Introduction to PC?<\/b><\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A personal computer is an electronic device capable of performing computations.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">As we know, it comprises of a monitor, keyboard, mouse, and memory to store information.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><b><span style=\"font-weight: 400;\">The essential component of the personal computer is a \u201cPROCESSOR.\u201d<\/span><\/b><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-2072 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6.png\" alt=\"\" width=\"525\" height=\"192\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6.png 525w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_6-300x110.png 300w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/h2>\n<h2><b>What is an Assembly Language?<\/b><\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The computer is an electronic device. Electronic signals or binary signals can perceive it.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b><span style=\"font-weight: 400;\">For example, the 4-volt electronic signal may represent binary number 1, while 0 volts may represent binary number 0.\u00a0<\/span><\/b><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Your PC will run continuously for these signals<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"size-full wp-image-2065 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_1.png\" alt=\"\" width=\"300\" height=\"227\" title=\"\"><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It is known as 8-bit computing.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Nowadays, the processor is capable of decoding 64-bit time.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">However, the question arises that what is the relation of this concept with the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_(programming_language)\" rel=\"nofollow noopener\" target=\"_blank\">programming language JAVA<\/a>?<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To understand this with an example.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let\u2019s add two numbers (3+1), which are categorized by some binary numbers (1100011), so how are we going to tell the computer?\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Correct, we are going to use assembly language to get our code executed.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now, we give the command to a computer in the format, as shown below.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><b><span style=\"font-weight: 400;\">Our code to add three numbers in this language would be in this order:<\/span><\/b><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"size-full wp-image-2066 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2.png\" alt=\"\" width=\"358\" height=\"306\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2.png 358w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_2-300x256.png 300w\" sizes=\"(max-width: 358px) 100vw, 358px\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let\u2019s Store number 1 at memory location say A<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let\u2019s Store number 2 at memory location say B<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let\u2019s Store number 3 at memory location say C<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Add contents of Location A, B &amp; C<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Store results<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The computer will read this code and execute the program.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">This would be a long process then until ASSEMBLER comes into action.<\/span><\/li>\n<\/ul>\n<h2><b>Introduction to Assembler and Compiler?<\/b><\/h2>\n<p><b>Assembler:\u00a0<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It is a program that converts the assembly language into machine language.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You can directly type your password into PC by using a program.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It converts machine code (110001&#8230;) and sends it to the processor.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let\u2019s have an example: Addition of (3+1), the assembler will convert code into machine code and provides the output.\u00a0<\/span><\/li>\n<\/ul>\n<p><b>Compiler:\u00a0<\/b><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400;\">It<\/span> <span style=\"font-weight: 400;\">is used for programs that translate the source code from a high-level programming language into a machine level language to create an executable program.<\/span><\/b><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2067 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3.png\" alt=\"\" width=\"569\" height=\"110\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3.png 569w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_3-300x58.png 300w\" sizes=\"(max-width: 569px) 100vw, 569px\" \/><\/p>\n<p><b>Difference:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The main difference between the <\/span><span style=\"font-weight: 400;\">Assembler<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">Compiler<\/span><span style=\"font-weight: 400;\"> is:<\/span><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400;\">The C<\/span><span style=\"font-weight: 400;\">ompiler<\/span><span style=\"font-weight: 400;\"> takes the source code and then translates it into the assembly code, whereas <\/span><span style=\"font-weight: 400;\">Assembler<\/span><span style=\"font-weight: 400;\"> acquires the Compiler generated assembly code and then converts it into the machine code.<\/span><\/b><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">As we say in software development languages, the whole assembly code could have diminished into one-line (<\/span><span style=\"font-weight: 400;\">print f 3+1 A)<\/span> <span style=\"font-weight: 400;\">with the help of a software called COMPILER.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The Compiler is used to convert your C language code into assembly code, and then the assembler converts it into the machine code, then machine code will be transmitted to the processor.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The commonly used processor used in PC or Computers is the Intel processor. Following is the diagram of the working of the process:<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2068 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4.png\" alt=\"\" width=\"559\" height=\"147\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4.png 559w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_4-300x79.png 300w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/p>\n<h2><b>The way how Java Virtual Machine works?<\/b><\/h2>\n<p>Java Virtual Machine<span style=\"font-weight: 400;\">\u00a0is working on different processors and O.S.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2069 aligncenter\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5.png\" alt=\"\" width=\"678\" height=\"128\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5.png 678w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/03\/Screenshot_5-300x57.png 300w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Here are the following steps which will help us to understand the work of Java Virtual Machine:<\/span><\/p>\n<ol>\n<li><b> <\/b><span style=\"font-weight: 400;\">Let&#8217;s have a code to display the addition of two numbers i.e., System.out.println(3+1) and save it as .java file.\u00a0<\/span><\/li>\n<li><b><\/b><span style=\"font-weight: 400;\">By using the java compiler code is converted into an intermediate code known as bytecode. The output is a\u00a0<\/span><b>.class file.<\/b><\/li>\n<li><b> <\/b><span style=\"font-weight: 400;\">The<\/span> <span style=\"font-weight: 400;\">Code is unable to understand by any platform until and unless a virtual platform called the Java Virtual Machine is present in the system.\u00a0<\/span><\/li>\n<li><b><\/b><span style=\"font-weight: 400;\">The Virtual Machine occupies the RAM of your operating system. When Virtual Machine gets this bytecode, it will recognize on which platform it is working on, and then it converts the bytecode into the native machine code.\u00a0<\/span><\/li>\n<\/ol>\n<h2><b>Now learn about how Java Platform is Independent?<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Java compiler does not produce local executable code for a particular machine.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">As <a href=\"https:\/\/www.h2kinfosys.com\/blog\/best-way-to-learn-java-programming-language\/\">Java<\/a> is platform-independent because machine-independent code is also called as bytecode.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Every time Java produces a unique bytecode.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b><span style=\"font-weight: 400;\">The bytecode is understandable to any JVM installed on any OS, and so we can say that java source code can run on all operating systems.<\/span><\/b><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Java What is java ? It is a programming language and platform for application development. It was first introduced by Sun Microsystem in 1995 and later obtained by Oracle Corporation.\u00a0 Nowadays, Java has mostly used programming language. About Java Platform It is a collection of programs that helps the user to develop and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[391,390,58,392,389],"class_list":["post-2063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-tutorials","tag-basics","tag-introduction","tag-java","tag-java-programming-language","tag-what-is-java"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=2063"}],"version-history":[{"count":0,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/2063\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/2106"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=2063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=2063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=2063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}