Pract
Pract
Our core Java programming tutorial is designed for students and working professionals. Java is
an object-oriented, class-based, concurrent, secured and general-purpose computer-programming
language. It is a widely used robust technology.
What is Java?
Java is a programming language and a pla orm. 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.
Ge ng Started
Before diving into coding, we will need to set up your development environment. Java development
typically requires the Java Development Kit (JDK), which includes the Java compiler and other
essen al tools. You can download the JDK from the official Oracle website and follow the installa on
instruc ons for your opera ng system.
Once we have the JDK installed, you can use a text editor or an Integrated Development Environment
(IDE) like IntelliJ IDEA, Eclipse, or NetBeans to write and run your Java code. IDEs provide features
such as code comple on, debugging, and project management, making them invaluable tools for
developers.
Pla orm: Any hardware or so ware environment in which a program runs, is known as a pla orm.
Since Java has a run me environment (JRE) and API, it is called a pla orm.
AD
Java Example
Let's have a quick look at Java programming example. A detailed descrip on of Hello Java example is
available in next page.
Simple.java
1. class Simple{
3. System.out.println("Hello Java");
4. }
5. }
Applica on
According to Sun Microsystems, 3 billion devices run Java. There are various devices where Java is
currently used. Some of them are as follows:
1. Desktop Applica ons such as acrobat reader, media player, an virus, etc.
4. Mobile
5. Embedded System
6. Smart Card
7. Robo cs
8. Games, etc.
There are the following 4-types of applica ons that can be created using Java programming:
1) Standalone Applica on
Standalone applica ons are also known as desktop applica ons or window-based applica ons. These
are tradi onal so ware that we need to install on every machine. Examples of standalone
applica on are Media player, an virus, etc. AWT and Swing are used in Java for crea ng standalone
applica ons.
2) Web Applica on
An applica on that runs on the server side and creates a dynamic page is called a web applica on.
Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF, etc. technologies are used for crea ng web
applica ons in Java.
3) Enterprise Applica on
An applica on that is distributed in nature, such as banking applica ons, etc. is called an enterprise
applica on. It has advantages like high-level security, load balancing, and clustering. In Java, EJB is
used for crea ng enterprise applica ons.
4) Mobile Applica on
An applica on which is created for mobile devices is called a mobile applica on. Currently, Android
and Java ME are used for crea ng mobile applica ons.
AD
It is a Java programming pla orm. It includes Java programming APIs such as java.lang, java.io,
java.net, java.u l, java.sql, java.math etc. It includes core topics like OOPs, String, Regex, Excep on,
Inner classes, Mul threading, I/O Stream, Networking, AWT, Swing, Reflec on, Collec on, etc.
It is an enterprise pla orm that is mainly used to develop web and enterprise applica ons. It is built
on top of the Java SE pla orm. It includes topics like Servlet, JSP, Web Services, EJB, JPA, etc.
AD
3) Java ME (Java Micro Edi on)
4) JavaFX
It is used to develop rich internet applica ons. It uses a lightweight user interface API.
AD
Prerequisite
To learn Java, you must have the basic knowledge of C/C++ programming language.
AD
Audience
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.
AD
This Java tutorial has provided you with a solid founda on to start your journey into the world of
Java programming. From se ng up your development environment to understanding basic syntax,
data types, control flow, object-oriented programming, and excep on handling, you've learned the
essen al concepts that will enable you to write Java code with confidence. As you con nue your
learning journey, don't hesitate to explore more advanced topics and prac ce wri ng code regularly
to reinforce your skills. Happy coding!
AD
1. Referring to the instance variable when a local variable has the same name
Show AnswerWorkspace
2) Which type of Java applica on uses GUI components like AWT, Swing, and JavaFX?
1. Web Applica ons
Show AnswerWorkspace
Show AnswerWorkspace
3. To prevent inheritance