JAVA program is used in, Mobile applications, Stand alone applications, dynamic applications and BigData(Hadoop) technology.



1. Standalone Applications:-

An application which never utilizes external resources for execution, it is known as standalone applications.
Ex: Calculators, music players, parking meters, etc.


2. Dynamic Applications:-

An application which utilizes external resources for execution, it is known as dynamic application.

External resources are like server facility, internet connectivity and database utilization.

Dynamic applications are also also known as server side app or web applications.
Ex: Amazon, Flipkart(e-commerce) etc.


Class body:-

After class declaration, open in curly braces and closed curly braces represent class body.

In a class body, programmer can be declare data members, member functions, blocks and constructor.

If programmer want to declare any executable statements then those statements need to be declared inside class body.

Declaring executable statements outside class body throws error.
(It is because of Encapsulation rule).



Main method:-


Main method places very important role in execution of java program because of main method is the entry point of Java program.

Without main method compilation takes place but execution don't.



Ex:-
class Demo
{
   public static void main(String [] args)
   {
      System.out.println("Hello");
   }
}


javac Demo.java
java Demo

O/p:- Hello


print:-
Prints the output and the cursor remains in the same line.



println:-

Prints the output and the cursor jumps to the next line.

Ex:-
class Demo1
{
   public static void main(String [] args)
   {
      System.out.print("Hello all");
      System.out.println("Hello");
   }
}


javac Demo1.java
java Demo

O/p:- Hello allHello



System.out.println("HI");
HI

System.out.println(2);
2

System.out.println("HI+HELLO");
HI+HELLO

System.out.println("2+2");
2+2

System.out.println(2+2);
4

System.out.println("hi"+"hello");
hihello

System.out.println("hi"+"hello"+"2+2");
hi+hello2+2

System.out.println(2+2+"hi");
4hi

System.out.println("hi"+2+2);
Hi22

System.out.println(2+2+"hi"+2+2);
4hi22

System.out.println("hi"+(2+2));
hi4





Post a Comment

Please do not enter any spam link in the comment box.

Previous Post Next Post