Friday, 6 January 2017

Introduction of Java

Introduction of Java: -

Java is a Machine Independent (Run on any computer) and High Level Programming Language. It is developed by Sun Microsoft's in 1995. Java is develop by James Gosling. It runs on basically Mac OS, Windows XP/7/8.1/10 and various versions of UNIX. Java doesn’t use header file instead use packages. In Java every class should always a part of package. If the user does not build any package then the compiler will automatically make default package i.e nothing

Simple Example of Java

class FirstJavaProgram //chosse any name of the class
public static void main(String args[])
            System.out.println("Hello World");
Output of the Program 
Hello World

write a program to print hello using function

class a
      void a1()
class a1
public static void main(String args[])
            a d1 = new a();


1)      Public – Access specifier
2)      Static – Keyword
3)      Void – return type
4)      Main – method
5)      Args – parameters
6)      ( )   – parenthesis
7)      System.out.println – same as printf or cout
8)      class name and file name are same

System.out.println Explanation

System is the inbuilt class and println is the member function of that class and out is the static object of the System class. We write out.println because for calling object to function we use object name.function name.We write System.out.println because static object are called when we create the class .Class name is System that’s why we use System.out.println

Where Java is used?

According to Sun, 3 billion devices run java. There are many devices where java is currently used. Some of them are as follows:
1)      Desktop Applications such as acrobat reader, media player, antivirus etc.
2)      Web Applications such as, etc.
3)      Enterprise Applications such as banking applications.
4)      Mobile
5)      Embedded System
6)      Smart Card
7)      Robotics
8)      Games etc.
You also read my other Android popular posts directly this links
  1. Best Discount at Education Courses and Hosting
  2. LeadBolt ads in Android Studio 
  3. Calculator
  4. AdMob ads in Android 

No comments:

Post a Comment