Hello world java program
As we have discussed all required detail to develop and execute a java program. Let us start java programming with first simple java program to print “Hello World”.
Create Hello world java program:
To understand above java program better let us have a brief look on it:
1. class: is a keyword used to declare a class with specific name.
2. public: is an access modifier.
3. static: is a keyword which can be used with class, method, variable/constant , block. If it is used with a method that method is known as static method. For static method invocation no need for object creation , method will be associate with class.
4. void : return type of the method , void means it does not return any value.
5. main : method is invoked by JVM, as it is static no need to create an object. It represent the program’s startup.
6. String args : represents the array of String type which is used in command line arguments.
1. System is a final class and its all members are static.
2. out is a public final static member of System class. out is of PrintStream type.
3. println() is the method of PrintStream class.
Program to print alphabets both in small and capital.
Program to perform arithmetic operations.
Program to find that given number is Armstrong or not.
Program to check that given number is even or odd.
Program to calculate Factorial of given number.
Program to find factorial of given number by recursion.
Program to print fibonacci series.
Program to find that given number is Palindrome or not.
Program to find that given number is prime or not.
Program to swap two numbers without using third or temp variable.