W3schools Home
Tutorials Library
Computer Science Fundamentals
Computer Fundamentals
Data Structure
Microsoft Windows
Operating System
HTTP
SDLC
Software Testing
Web Design
HTML
HTML5
CSS3
SCSS
Responsive Web Design
Bootstrap 4
Programming Languages
C Programming
C++ Programming
C++ 11
Java Programming
JAVA Questions and Answers
Python Programming
Python Data Science
Matplotlib
R Programming
Golang
C Sharp Programming
Swift
Mojo
Scripting Languages
JSP
PHP
PHP 8
Web Development
JavaScript
jQuery
React
Angular
Express.js
WordPress
Laravel
RESTful Web Services
PWA (Progressive Web Application)
Web Hosting
Database Design and Development
SQL (Structured Query Language)
DBMS (Database Management System)
MySQL
MongoDB
Data Interchange Formats
JSON
XML
Software Development Tools
GIT
Mobile Development
Android
Network & Security
Cyber Security
Ethical Hacking
Artificial Intelligence
Machine Learning
TensorFlow
Special Topics
Technical Writing
Entrepreneurship
Cloud Computing
Blockchain
Key Definitions
Definition
Example Programs
CSS Examples
C Programming Examples
C++ Programming Examples
Java Programming Examples
Python Programming Examples
PHP Examples
JavaScript Examples
Practice Tests
Computer Fundamentals Practice Tests
HTML Practice Tests
CSS3 Practice Tests
C Programming Practice Tests
JSP Practice Tests
Development Tools
HTML Editor
PHP Interpreter
PX to REM Converter
SCSS to CSS Converter
JSON Viewer
Java Programming Examples Index
35 Examples
The best way to learn Java is by practicing examples. This page has lots of examples of Java programming. You are advised to look at these examples and try them yourself.
Java String Programs
Java Program to Get User Input and Print on Screen
Java Program to Compare Two Strings
Java Program to Remove White Spaces
Java Program to Concatenate Two Strings Using concat Method
Java Program to Find Duplicate Characters in a String
Java Program to Convert String to ArrayList
Java Program to Check Whether Given String is a Palindrome
Java Program to Convert String to Int
Java Program to Remove All Spaces From Given String
Java Program to Find ASCII Value of a Character
C Language Fundamentals
Java Program to Compare Between Two Dates
Java Program to Demonstrate Switch Case
Java Number Programs
Java Program to Generate Random Numbers
Java Program to Swapping Two Numbers Using a Temporary Variable
Java Program to Perform Addition, Subtraction, Multiplication and Division
Java Program to Calculate Simple and Compound Interest
Java Program to Find Largest and Smallest Number in an Array
Java Program to Find Reverse Number
Java Program to Find Factorial
Java Program to Generate the Fibonacci Series
Java Program to Swapping Two Numbers without Using a Temporary Variable
Java Program to Print Prime Numbers
Java Program to Print Invert Triangle
Java Program to Toss a Coin
Java Program to Find odd or even Numbers in an Array
Java Program to Calculate the Area of a Circle
Calculate the Power of Any Number in the Java Program
Java Program to Add Two Integers
Java Program to Check Even or Odd Number
Java Program to Check Leap Year
Java Program to Validate Armstrong Number
Java Function Programs
Java Program to Call Method in Same Class
Java Program to Find Factorial of a Number Using Recursion
Java Program to Reverse a Sentence Using Recursion
Other Java Programs
Reading Content in Java from URL