Constructor java tutorial: Java constructors are the methods which are used to initialize objects. Co...
Java static method
Java static method program: static methods in Java can be called without creating an object of class....
Java static block program
Java programming language offers a block known as static which is executed before main method execute...
Java methods
Java methods tutorial: Java program consists of one or more classes and a class may contain meth...
How to get input from user in java
This program tells you how to get input from user in a java program. We are using Scanner class ...
Java program to print alphabets
This program print alphabets on screen i.e a, b, c, ..., z. Here we print alphabets in lower case....
For loop loop program in java
Java for loop used to repeat execution of statement(s) until a certain condition holds true. for ...
Java if else program
Java if else program uses if else to execute statement(s) when a condition is fulfilled. Below is a simple program which explains the us...
Bubble sort program in Java
Java program to bubble sort: This code sorts numbers inputted by user using Bubble sort algorithm. Java programming code impo...
Java program to get ip address
This program prints IP or internet protocol address of your computer system. InetAddress class of java.net package is used, getLo...
Java program to compare two strings
This program compare strings i.e test whether two strings are equal or not, compareTo method of String class is used to test equality of t...
armstrong number program in java
This java program checks if a number is Armstrong or not. Armstrong number is a number which is equal to sum of digits raise to...
Factorial program in java
import java.util.Scanner; class Factorial { public static void main(String args[]) { int n, c, fact = 1; S...
Palindrome program in java
import java.util.*; class Palindrome { public static void main(String args[]) { String original, reverse=""; ...
Calculator program in java
import java.util.Scanner; import java.io.*; public class Calculator { public static void main(String[] args) { int choice; ...