ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Basic concepts of JAVA

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

    Check Your Domain Ranking

    Updated: January 31, 2016 — 1:36 am

    2 Comments

    Add a Comment
    1. Nice post.Thank you!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    ITSourceCode.com © 2016 Frontier Theme

    Subscribe For Latest Updates

    Signup for our newsletter and get notified when we publish new articles for free!