0% found this document useful (0 votes)
13 views

Java Module (Minggu 2)

This document provides an introduction to Java programming, including: - A brief overview of what Java is and its history - Reasons for using Java such as its cross-platform capabilities and large developer community - The four main types of applications that can be created with Java: standalone, web, enterprise, and mobile - The four Java platforms: SE, EE, ME, and JavaFX - Steps for installing and setting up Java on Windows - A simple "Hello World" example to get started with writing and running a Java program

Uploaded by

Markus Silitonga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Java Module (Minggu 2)

This document provides an introduction to Java programming, including: - A brief overview of what Java is and its history - Reasons for using Java such as its cross-platform capabilities and large developer community - The four main types of applications that can be created with Java: standalone, web, enterprise, and mobile - The four Java platforms: SE, EE, ME, and JavaFX - Steps for installing and setting up Java on Windows - A simple "Hello World" example to get started with writing and running a Java program

Uploaded by

Markus Silitonga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Praktik Pemrograman C#

Chapter 1. Java Introduction

1.1 What is Java?


Java is a popular programming language, created in 1995. Java is
a programming language and a platform. Java is a high level, robust, object-
oriented and secure programming language.
Java was developed by Sun Microsystems (which is now the subsidiary of
Oracle) in the year 1995. James Gosling is known as the father of Java. Before
Java, its name was Oak. Since Oak was already a registered company, so James
Gosling and his team changed the name from Oak to Java.
It is owned by Oracle, and more than 3 billion devices run Java.
It is used for:
• Mobile applications (specially Android apps)
• Desktop applications
• Web applications
• Web servers and application servers
• Games
• Database connection
• And much, much more!

1.2 Why Use Java?


There are some reasons why Java used.
a) Java works on different platforms (Windows, Mac, Linux, Raspberry
Pi, etc.)
b) It is one of the most popular programming language in the world
c) It has a large demand in the current job market
d) It is easy to learn and simple to use
e) It is open-source and free
f) It is secure, fast and powerful
g) It has a huge community support (tens of millions of developers)
h) Java is an object oriented language which gives a clear structure to
programs and allows code to be reused, lowering development costs
i) As Java is close to C++ and C#, it makes it easy for programmers to
switch to Java or vice versa

1.3 History of Java


The history of Java is very interesting. Java was originally designed for
interactive television, but it was too advanced technology for the digital cable

Disusun Oleh : Kadri Yusuf [1]


Praktik Pemrograman C#

television industry at the time. The history of Java starts with the Green Team.
Java team members (also known as Green Team), initiated this project to
develop a language for digital devices such as set-top boxes, televisions, etc.
However, it was best suited for internet programming. Later, Java technology
was incorporated by Netscape.
The principles for creating Java programming were "Simple, Robust, Portable,
Platform-independent, Secured, High Performance, Multithreaded,
Architecture Neutral, Object-Oriented, Interpreted, and Dynamic". Java was
developed by James Gosling, who is known as the father of Java, in 1995.
James Gosling and his team members started the project in the early '90s.

Currently, Java is used in internet programming,


mobile devices, games, e-business solutions, etc.
Following are given significant points that
describe the history of Java.

1.4 Types of Java Applications


There are mainly 4 types of applications that can be created using Java
programming:
a. Standalone Application
Standalone applications are also known as desktop applications or
window-based applications. These are traditional software that we
need to install on every machine. Examples of standalone application
are Media player, antivirus, etc. AWT and Swing are used in Java for
creating standalone applications.
b. Web Application
An application that runs on the server side and creates a dynamic
page is called a web application. Currently, Servlet, JSP, Struts,
Spring, Hibernate, JSF,etc. Technologies are used for creating web
applications in Java.
c. Enterprise Application
An application that is distributed in nature, such as banking
applications, etc. is called an enterprise application. It has advantages

Disusun Oleh : Kadri Yusuf [2]


Praktik Pemrograman C#

like high-level security, load balancing, and clustering. In Java, EJB is


used for creating enterprise applications.
d. Mobile Application
An application which is created for mobile devices is called a mobile
application. Currently, Android and Java ME are used for creating
mobile applications.

1.5 Java Platforms / Editions


There are 4 platforms or editions of Java:
a. Java SE (Java Standard Edition)
It is a Java programming platform. It includes Java programming APIs
such as java.lang, java.io, java.net, java.util, java.sql, java.math etc. It
includes core topics like OOPs, String, Regex, Exception, Inner
classes, Multithreading, I/O Stream, Networking, AWT, Swing,
Reflection, Collection, etc.
b. Java EE (Java Enterprise Edition)
It is an enterprise platform that is mainly used to develop web and
enterprise applications. It is built on top of the Java SE platform. It
includes topics like Servlet, JSP, Web Services, EJB, JPA, etc.
c. Java ME (Java Micro Edition)
It is a micro platform that is dedicated to mobile applications.
d. JavaFX
It is used to develop rich internet applications. It uses a lightweight
user interface API.
The estimated total pay for a Java Programmer is $87,249 per year in
the United States area, with an average salary of $81,219 per year. These
numbers represent the median, which is the midpoint of the ranges from our
proprietary Total Pay Estimate model and based on salaries collected from our
users. The estimated additional pay is $6,030 per year. Additional pay could
include cash bonus, commission, tips, and profit sharing. The "Most Likely
Range" represents values that exist within the 25th and 75th percentile of all
pay data available for this role.

Prerequisite
To learn Java, you must have the basic knowledge of C/C++ programming
language.

Disusun Oleh : Kadri Yusuf [3]


Praktik Pemrograman C#

Audience
Our Java programming tutorial is designed to help beginners and
professionals.
Problem
We assure that you will not find any problem in this Java tutorial. However, if
there is any mistake, please post the problem in the contact form.

Disusun Oleh : Kadri Yusuf [4]


Praktik Pemrograman C#

Chapter 2. Java Getting Started


2.1 Java Install
In Some PCs might have Java already installed. To check if you have Java
installed on a Windows PC, search in the start bar for Java or type the
following in Command Prompt (cmd.exe):

If Java is installed, you will see something like this (depending on version):

If you do not have Java installed on your computer, you can download it for
free at oracle.com.
Note: In this tutorial, we will write Java code in a text editor. However, it is
possible to write Java in an Integrated Development Environment, such as
IntelliJ IDEA, Netbeans or Eclipse, which are particularly useful when
managing larger collections of Java files.

2.2 Setup for Windows


To install Java on Windows:
1. Go to "System Properties" (Can be found on Control Panel > System and
Security > System > Advanced System Settings)
2. Click on the "Environment variables" button under the "Advanced" tab
3. Then, select the "Path" variable in System variables and click on the
"Edit" button
4. Click on the "New" button and add the path where Java is installed,
followed by \bin. By default, Java is installed in C:\Program
Files\Java\jdk-11.0.1 (If nothing else was specified when you installed
it). In that case, You will have to add a new path with: C:\Program
Files\Java\jdk-11.0.1\bin
Then, click "OK", and save the settings
5. At last, open Command Prompt (cmd.exe) and type java -version to see
if Java is running on your machine

Disusun Oleh : Kadri Yusuf [5]


Praktik Pemrograman C#

Disusun Oleh : Kadri Yusuf [6]


Praktik Pemrograman C#

Disusun Oleh : Kadri Yusuf [7]


Praktik Pemrograman C#

Disusun Oleh : Kadri Yusuf [8]


Praktik Pemrograman C#

2.3 Java Quickstart


In Java, every application begins with a class name, and that class must
match the filename.
Let's create our first Java file, called Main.java, which can be done in any text
editor (like Notepad).
The file should contain a "Hello World" message, which is written with the
following code:

Don't worry if you don't understand the code above - we will discuss it in detail
in later chapters. For now, focus on how to run the code above.
Save the code in Notepad as "Main.java". Open Command Prompt (cmd.exe),
navigate to the directory where you saved your file, and type "javac Main.java":

This will compile your code. If there are no errors in the code, the command
prompt will take you to the next line. Now, type "java Main" to run the file:

Disusun Oleh : Kadri Yusuf [9]


Praktik Pemrograman C#

References:
1. https://www.javatpoint.com/history-of-java
2. Java Getting Started (w3schools.com)
3. Source : https://www.glassdoor.com/Salaries/java-programmer-salary-
SRCH_KO0,15.htm
4.

Disusun Oleh : Kadri Yusuf [10]

You might also like