-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogramming-language-java.html
235 lines (183 loc) · 23.2 KB
/
programming-language-java.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>PrograMix</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<style>
body {
padding-top: 70px;
/* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
font-size: 15px;
font-style: verdana;
}
li{
color: #33AAFF;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="images/logo-trans-134px.png" style="margin-top: -10px"></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<!-- languages nav and dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Programming Languages<span class="caret"></span></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="programming-language-java.html">Java</a></li>
<li><a class="dropdown-item" href="programming-language-python.html">Python</a></li>
<li><a class="dropdown-item" href="programming-language-haskell.html">Haskell</a></li>
<li><a class="dropdown-item" href="programming-language-php.html">PHP</a></li>
<li><a class="dropdown-item" href="programming-language-c++.html">C++</a></li>
<li><a class="dropdown-item" href="programming-language-c_sharp.html">C#</a></li>
<li><a class="dropdown-item" href="programming-language-ios.html">IOS - Objective-C</a></li>
<li><a class="dropdown-item" href="programming-language-SQL.html">SQL</a></li>
<li><a class="dropdown-item" href="programming-language-Perl.html">Perl</a></li>
<li><a class="dropdown-item" href="programming-language-JavaScript.html">JavaScript</a></li>
</ul>
</div>
</li><!--end of languages dropdown-->
<!--tutorials in nav and dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Tutorials<span class="caret"></span></a>
<!-- Tutorials dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="tutorials-java.html">Java</a></li>
<li><a class="dropdown-item" href="tutorials-python.html">Python</a></li>
<li><a class="dropdown-item" href="tutorials-haskell.html">Haskell</a></li>
<li><a class="dropdown-item" href="tutorials-php.html">PHP</a></li>
<li><a class="dropdown-item" href="tutorials-c++.html">C++</a></li>
<li><a class="dropdown-item" href="tutorials-c_shar.html">C#</a></li>
<li><a class="dropdown-item" href="tutorials-ios.html">IOS - Objective-C</a></li>
<li><a class="dropdown-item" href="tutorials-sql.html">SQL</a></li>
<li><a class="dropdown-item" href="tutorials-perl.html">Perl</a></li>
<li><a class="dropdown-item" href="tutorials-js.html">JavaScript</a></li>
</ul>
</div>
</li><!-- end of tutorials -->
<!--programming software in navbar with dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Programming Softwares<span class="caret"></span></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="prosoft-nb.html">NetBeans</a></li>
<li><a class="dropdown-item" href="prosoft-jc.html">JCreator</a></li>
<li><a class="dropdown-item" href="prosoft-st.html">Sublime Text</a></li>
<li><a class="dropdown-item" href="prosoft-eclipse.html">Eclipse</a></li>
<li><a class="dropdown-item" href="prosoft-xcode.html">Xcode</a></li>
</ul>
</div>
</li><!-- end of programming softwares -->
<!-- search bar icon w/ dropdown searchbox-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false"><img src="images/search-icon.png"></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<form method="get" action="/search" id="search">
<input name="q" type="text" size="40" placeholder="Search..." />
</form>
</div>
</li><!-- end of search bar-->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content w/ container-->
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<div class="well"><h1>JAVA</h1></div>
<p class="lead" style="margin-top: 50px;"><b>What is Java Programming?</b></p>
<p class="lead" style="text-indent: 40px">Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. As of 2016, Java is one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers. Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.</p>
<p class="lead" style="text-indent: 40px">The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licenses. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).</p>
<p class="lead" style="margin-top: 30px"><b>History</b></p>
<p class="lead" style="text-indent: 40px">James Gosling, Mike Sheridan, and Patrick Naughton 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. The language was initially called Oak after an oak tree that stood outside Gosling's office. Later the project went by the name Green and was finally renamed Java, from Java coffee. Gosling designed Java with a C/C++-style syntax that system and application programmers would find familiar.</p>
<p class="lead" style="text-indent: 40px">Sun Microsystems released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost run-times on popular platforms. Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. The Java 1.0 compiler was re-written in Java by Arthur van Hoff to comply strictly with the Java 1.0 language specification. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 – 1999), new versions had multiple configurations built for different types of platforms. J2EE included technologies and APIs for enterprise applications typically run in server environments, while J2ME featured APIs optimized for mobile applications. The desktop version was renamed J2SE. In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively.</p>
<p class="lead" style="text-indent: 40px">In 1997, Sun Microsystems approached the ISO/IEC JTC 1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process. Java remains a de facto standard, controlled through the Java Community Process. At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System.</p>
<p class="lead" style="text-indent: 40px">On November 13, 2006, Sun released much of its Java virtual machine (JVM) as free and open-source software, (FOSS), under the terms of the GNU General Public License (GPL). On May 8, 2007, Sun finished the process, making all of its JVM's core code available under free software/open-source distribution terms, aside from a small portion of code to which Sun did not hold the copyright.</p>
<p class="lead" style="text-indent: 40px">Sun's vice-president Rich Green said that Sun's ideal role with regard to Java was as an "evangelist".Following Oracle Corporation's acquisition of Sun Microsystems in 2009–10, Oracle has described itself as the "steward of Java technology with a relentless commitment to fostering a community of participation and transparency". This did not prevent Oracle from filing a lawsuit against Google shortly after that for using Java inside the Android SDK (see Google section below). Java software runs on everything from laptops to data centers, game consoles to scientific supercomputers. On April 2, 2010, James Gosling resigned from Oracle.</p>
<p class="lead" style="text-indent: 40px">In January 2016, Oracle announced that Java runtime environments based on JDK 9 will discontinue the browser plugin.</p>
<p class="lead" style="margin-top: 30px"><b>Principles</b></p>
<p class="lead" style="text-indent: 40px">There were five primary goals in the creation of the Java language:</p>
<ul>
<li>It must be "simple, object-oriented, and familiar".</li>
<li>It must be "robust and secure".</li>
<li>It must be "architecture-neutral and portable".</li>
<li>It must execute with "high performance".</li>
<li>It must be "interpreted, threaded, and dynamic".</li>
</ul>
<p class="lead" style="margin-top: 30px"><b>Versions</b></p>
<p class="lead" style="text-indent: 40px">As of 2015, only Java 8 is officially supported. Major release versions of Java, along with their release dates:</p>
<ul>
<li>JDK 1.0 (January 23, 1996)</li>
<li>JDK 1.1 (February 19, 1997)</li>
<li>J2SE 1.2 (December 8, 1998)</li>
<li>J2SE 1.3 (May 8, 2000)</li>
<li>J2SE 1.4 (February 6, 2002)</li>
<li>J2SE 5.0 (September 30, 2004)</li>
<li>Java SE 6 (December 11, 2006)</li>
<li>Java SE 7 (July 28, 2011)</li>
<li>Java SE 8 (March 18, 2014)</li>
</ul>
<p class="lead" style="margin-top: 30px"><b>Practices:</b></p>
<p class="lead" style="margin-top: 30px"><b>Java Platform</b></p>
<p class="lead" style="text-indent: 40px">One design goal of Java is portability, which means that programs written for the Java platform must run similarly on any combination of hardware and operating system with adequate runtime support. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to architecture-specific machine code. Java bytecode instructions are analogous to machine code, but they are intended to be executed 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, or in a web browser for Java applets.</p>
<p class="lead" style="text-indent: 40px">Standard libraries provide a generic way to access host-specific features such as graphics, threading, and networking.</p>
<p class="lead" style="text-indent: 40px">The use of universal bytecode makes porting simple. However, the overhead of interpreting bytecode into machine instructions made interpreted programs almost always run more slowly than native executables. Just-in-time (JIT) compilers that compile bytecodes to machine code during runtime were introduced from an early stage. Java itself is platform-independent and is adapted to the particular platform it is to run on by a Java virtual machine for it, which translates the Java bytecode into the platform's machine language.</p>
<p class="lead" style="margin-top: 30px"><b>Implementations</b></p>
<p class="lead" style="text-indent: 40px">Oracle Corporation is the current owner of the official implementation of the Java SE platform, following their acquisition of Sun Microsystems on January 27, 2010. This implementation is based on the original implementation of Java by Sun. The Oracle implementation is available for Microsoft Windows (still works for XP, while only later versions currently officially supported), macOS, Linux, and Solaris. Because Java lacks any formal standardization recognized by Ecma International, ISO/IEC, ANSI, or other third-party standards organization, the Oracle implementation is the de facto standard.</p>
<p class="lead" style="text-indent: 40px">The Oracle implementation is packaged into two different distributions: The Java Runtime Environment (JRE) which contains the parts of the Java SE platform required to run Java programs and is intended for end users, and the Java Development Kit (JDK), which is intended for software developers and includes development tools such as the Java compiler, Javadoc, Jar, and a debugger.</p>
<p class="lead" style="text-indent: 40px">OpenJDK is another notable Java SE implementation that is licensed under the GNU GPL. The implementation started when Sun began releasing the Java source code under the GPL. As of Java SE 7, OpenJDK is the official Java reference implementation.</p>
<p class="lead" style="text-indent: 40px">The goal of Java is to make all implementations of Java compatible. Historically, Sun's trademark license for usage of the Java brand insists that all implementations be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platform-specific features of their own. Sun sued in 1997, and, in 2001, won a settlement of US$20 million, as well as a court order enforcing the terms of the license from Sun. As a result, Microsoft no longer ships Java with Windows.</p>
<p class="lead" style="text-indent: 40px">Platform-independent Java is essential to Java EE, and an even more rigorous validation is required to certify an implementation. This environment enables portable server-side applications.</p>
<p class="lead" style="margin-top: 30px"><b>Performance</b></p>
<p class="lead" style="text-indent: 40px">Programs written in Java have a reputation for being slower and requiring more memory than those written in C++.However, Java programs' execution speed improved significantly with the introduction of just-in-time compilation in 1997/1998 for Java 1.1, the addition of language features supporting better code analysis (such as inner classes, the StringBuilder class, optional assertions, etc.), and optimizations in the Java virtual machine, such as HotSpot becoming the default for Sun's JVM in 2000. With Java 1.5, the performance was improved with the addition of the java.util.concurrent package, including Lock free implementations of the ConcurrentMaps and other multi-core collections, and it was improved further Java 1.6.</p>
<p class="lead" style="text-indent: 40px">Some platforms offer direct hardware support for Java; there are microcontrollers that can run Java in hardware instead of a software Java virtual machine, and some ARM based processors could have hardware support for executing Java bytecode through their Jazelle option, though support has mostly been dropped in current implementations of ARM.</p>
<p class="lead" style="margin-top: 30px"><b>Automatic memory management</b></p>
<p class="lead" style="text-indent: 40px">Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown.</p>
<p class="lead" style="text-indent: 40px">One of the ideas behind Java's automatic memory management model is that programmers can be spared the burden of having to perform manual memory management. In some languages, memory for the creation of objects is implicitly allocated on the stack or explicitly allocated and deallocated from the heap. In the latter case, the responsibility of managing memory resides with the programmer. If the program does not deallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable or crash. This can be partially remedied by the use of smart pointers, but these add overhead and complexity. Note that garbage collection does not prevent "logical" memory leaks, i.e., those where the memory is still referenced but never used.</p>
<p class="lead" style="text-indent: 40px">Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily. Explicit memory management is not possible in Java.</p>
<p class="lead" style="text-indent: 40px">As in C++ and some other object-oriented languages, variables of Java's primitive data types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as is commonly true for non-primitive data types (but see escape analysis). This was a conscious decision by Java's designers for performance reasons.</p>
<p class="lead" style="text-indent: 40px">Java contains multiple types of garbage collectors. By default, HotSpot uses the parallel scavenge garbage collector. However, there are also several other garbage collectors that can be used to manage the heap. For 90% of applications in Java, the Concurrent Mark-Sweep (CMS) garbage collector is sufficient.Oracle aims to replace CMS with the Garbage-First collector (G1).</p>
<p class="lead" style="text-indent: 40px">In terms of popularity, Java has been the main rival of C sharing the first couple of spots. It won the “Programming language of 2015” award, and, according to Oracle, is actively used by 9 million developers.</p><br>
<p class="lead" style="text-indent: 40px">Java is one of the most popular, most adopted and general purpose programming language used by millions of developers and billions of devices around the world. It is a class-based, object-oriented language and designed to be portable, which means that you can find it on all platforms, operating systems, and devices. It is used to develop all kinds of Android apps, desktop apps, and video games. It is also commonly used as a server-side language for enterprise-level backend development. This programming language has long-term compatibility and developers are comfortable with Java.</p>
<br>
<br>
<br>
<br>
</div>
</div>
<!-- /.row -->
</div>
<!-- end of content & container -->
<!-- jQuery Version 1.11.1 -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>