Posts

Showing posts from February, 2014

Loops

Image
A simple introduction about Loops in java programming There are mainly three types of loops.                  1.For loop                  2.While loop                  3.Do While loop As in the name the "Loop" means a cycle ,which it stops after a certain boolen condition. In this post i will describe about the For loop. Here is a small Example for the for loop. class Myjava {     public static void main(String args[]){         for(int x=0 ; x<5 ; x++){         System.out.print("kamal-->");         System.out.println(x);         }     } } out put of the ...

Methods

A simple introduction to the Methods Declaring a Method A Small Example for declaring a method. void count( ){ } I explain the above method. void   - The keyword "void" is the return type of the method. count - Name of the method. ( )      - Inside these brackets we can have the method parameters. A simple programme for explain methods Example 1 -     class Test{     int x= 8;     int y=3;     void Add(){         System.out.println("Addition :"+(x+y));     }     void Sub(){         System.out.println("Subtraction :"+(x-y));     }     void Multiply(){         System.out.println("Multiplication :"+(x*y));     }     void Divide(){         System.out.println("Division :"+(x/y));     }     public static void main(String args[ ]){...

variables

A simple introduction to the variables in a programming language Today i will write about the variables in a programming language. There are two types of variables           1.Primitive variables           2.Reference Variables 1. Primitive Variables byte                    short int long float double boolean char a simple programme to get an idea about primitive variables. Example 1 - public class Test1{        public static void main(String args[]){            int x; // declare a int type variable(variable name is x)            x=10; // initialize the variable x to value 10            System.out.println("The value of the x :"+x);            x=20; // reinitialize the variable         ...