Basic Concepts of Java

2
26

Today I m going to  tell you the basic concepts of JAVA .

First of all,a Java program can be considered as a bunch of Objects which uses or invokes methods(functions) to communicate among them.

Let us see what these objects and methods consist of:

1. Object -an object has their  own states and behaviours. For example A fan .A Fan has its own state that means it has its own color,own shades and behaviour is” moving” of a fan. An Object is called the

instance of a class. Now wondering what is a class??

Then let me tell you..

2. Class -It can be called as a blueprint consisting of states and behaviour. For example

public class Fan
 {
   String Company name;
   String color;

   void moving(){
   }
}

3.Methods – As described earlier a method is actually a behaviour  . A single class can have as many methods as the user wishes. It is actually the  methods where the logics are written to execute a program.

Your First JAVA Program

public class Fan {

   /* This will print 'Fan is a comfortable tool' as the output*/
    
	
    public static void main(String []args) {
       System.out.println("Fan is a comfortable tool");
 //prints Fan is a comfortable tool
 }
 }
Facebook Comments
(Visited 36 times, 1 visits today)

    2 COMMENTS

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here