Java Programming examples organized by topics and Java packages. You will find all examples with sample code and easy explanations.
Java Programming Examples with explanations
Java Programming is very popular in development and deployment of various kinds of applications. Java is also very relevant in Big Data field as it provides API and frameworks for development of application for Big Data. Hadoop and its ecosystem components are also mostly written in Java. Hadoop also needs JVM to run. So, Java is very relevant these days also, companies are looking for Java programmers with right skill sets.
In this section we are giving you the Java Programming examples which is organized into topics and based on the developer experience level. We have organized examples for beginners, advance level for experienced programmers, programming frameworks and by Java programming packages/API.
Java programming example for beginners
Beginners in Java programming language should start with the setting-up of their development environment. This requires you to download correct JDK for your operating system, install JDK and setup environment variables. Here are the tutorials for total beginner in Java:
- What is Java?
- Installing JDK 8 on Windows 10 and configuring the settings
- Writing Hello World Java program
- Hello World program explained - Explanation of the Hello World program in Java.
- Create first program in Java - Detailed explanation of first program in Java.
- Learn Core Java - Check example programs with out of each program, try these programs and learn as many as you can.
- Variables - What variables in Java? How to create and use variables in Java?
- Class - What are classes in Java and how to work with classes?
- Add Two Numbers in Java - Simple example of adding two numbers in Java
- Java Control Statements - What is control statement in Java and how to use it in real programming?
- Oops Principles - Learn the OOPs principles of Java
Java Example for Beginners
After completing above tutorials you should practice following examples.
- Comparing Two Numbers - How to compare two numbers in Java?
- Determining the largest number - How to determine largest number from given numbers.
- List all even numbers between two numbers - Example to work with the even numbers
- Calculate area and perimeter of a circle - Example of calculating the perimeter of circle.
- Calculate factorial of any given number - How to calculate factorial of any given numbers?
- Palindrome Number Example in Java - Example of palindrome number using Java program.
- Program for calculating area and perimeter of a rectangle
- Program to construct a triangle with the ?*?
- Checking whether a year is leap or not - How to check if a year is leap year?
- Listing out leap years between certain period - Get the list of leap yea between given period
- Preparing table of a number by using loop
- Finding out the prime number - How to find a prime number?
- Prime Number in Java - How work with prime number in Java
- OOP In Java - Learn
the Object Oriented Programming or OOP
concept of Java.
Advanced Java Technologies
Now you should learn the advanced topics in Java Programming language.
- Learn
JSP
- JSP or Java Server Pages is Java technology which is used for creating
dynamic web applications. Learning JSP is also very important as
you will have to work on the web applications.
-
Learn Servlet
- Servlet is Java program that runs on the Servlet container and generates
dynamic content in web application. JSP is finally compiles in
Java Servlet and runs as Servlet on the Servlet container such
as Tomcat.
-
Learn about Tomcat and other servers - Tomcat is
Servlet container which is used for running the Java based web
applications. You should learn Tomcat server also.
-
Learn Open Source technologies (Struts,
Hibernate,
Spring) -
Now you should learn various frameworks used for development of
enterprise web applications. Top Java based frameworks to learn
are Struts,
Hibernate,
Spring and
Hibernate.
- Learn EJB
- Enterprise Java Beans is also very import in application development and
you should learn this also.
- Learn about Database Management System - Without you can't think of dynamic web applications, database is used for saving the data of the application. You should at least learn MySQL database management system.
Java tutorials by Java packages
Here are tutorials of Java programming language organized by Java packages.
Example of java.util.* package:
- Java util package (java.util.*) example list
- What is java.util package?
- Generating a Random Number - Example of generating random numbers using the classes of java.util package.
- Breaking a String into Words - Example of breaking the string into words with help of classes of java.util package.
- Listing All Available Locales - How to find all locale in Java?
- Setting the Default Locale - How to get information about default local and set default local?
- Comparing Arrays - How to compare arrays?
Example of wrapper classes in Java
Wrapper classes are wrapper around the primitive data types in Java. Sometimes primitive data types can't be used easily and at that time wrapper classes are used. Here are tutorials of wrapper classes in Java:
Java File and I/O classes
Here are example of file handling and I/O classes in Java:
Java Collection Framework examples
Let's see the examples of Collection frameworks in Java:
- Introduction to Collections Framework
- Collection Interfaces
- Set Interface
- List and Queue Interface
- Introduction to Map and SortedMap Interface
Java Swing Examples
Java Swing is mostly used to create desktop applications in Java. Here are tutorials of Java Swing:
- Java Swing Tutorials
- Progress Bar in Java Swing
- Creating Check Box in Java Swing
- Login Form in Swing
- Combo Box operation in Java Swing
Check all the Java tutorials.