Html Design

Design By Masudul

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Friday, April 6, 2018

Array Input Output of Java

/* Assigning value to array elements through keyboard */
package webpractrice;

import java.io.*;
public class WebPractrice

    public static void main(String[] args) throws IOException
    {
        int Roll[] = new int [5];
        String S[] = new String[5];
        for (int i = 0; i < 5; i++)
        {
            System.out.print("\nEnter Your ID [" +i +"] : ");
            BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
            S[i] = BR.readLine();
            Roll[i] = Integer.parseInt(S[i]);
        }
        for(int i = 0; i < 5; i++)
        {
            System.out.println("\nID[" +i+ "] = "+Roll[i]);
        }
    }
   
}









Share:

Thursday, April 5, 2018

Explain of Array types


Dimension Explain of Array :-


Array can be divided into the following categories based on the dimension.
1.     One dimensional array.
2.     Two dimensional array.
3.     Multi-dimensional array.
One Dimensional Array :
  Array is a dimensional array balloon made with a single user.

Its structure :
data_type array_name[ size ];
Example :
int i[ 10 ];
float a[ 10 ];
char ch[ 20 ];
double b[ 5 ];

Two Dimensional Array :

  Array is a dimensional array balloon made with a two user.
          Its structure :
                    data_type array_name[ row_size ][ col_size ];
          Example :
                    int student[ 3 ][ 4 ]; 
60
[ 0 ][ 0 ]
80
[ 0 ][ 1 ]
75
[ 0 ][ 2 ]
62
[ 0 ][ 3 ]

40
[ 1 ][ 0 ]
90
[ 1 ][ 1 ]
82
[ 1 ][ 2 ]
34
[ 1 ][ 3 ]





25
[ 2 ][ 0 ]
10
[ 2 ][ 1 ]
35
[ 2 ][ 2 ]
42
[ 2 ][ 3 ]





Multi-dimensional Array :

  Array is a dimensional array balloon made with a three or more than user.
          Its structure :
                    Data_type array_name[ s1 ][ s2 ]….[ sn ];
          Example :
                    int s[ 2 ][ 3 ][ 4 ];
                    float table[ 5 ][ 6 ][ 4 ][ 5 ];


Initialization :


One Dimensional Array :
Static data_type array_name[ size ] = { list of values };
Example : static int number[ 3 ] = { 5, 0, 7 };

Two Dimensional Array :


There are same type of one dimensional array;
Example : static int table[ 2 ][ 3 ] = { 1, 2, 3, 4, 5, 6 };
Example of Matrix: static int table[ 2 ][ 3 ] = {{ 1, 2, 3}, {4, 5, 6} };


Share:

Array output in Java code

/* Example of Array Output */
package ArrayOutput;
public class ArrayOutput
{
    public static void main(String[] args)
    {
        int marks[] = {23, 54, 34, 10, 15, 30, 25};
        for(int i = 0; i <= 6; i++)
        {
            prln("Mark["+i+"] = "+marks[i]);
        }
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}















Share:

Monday, March 26, 2018

Precedence of Java code

/* Example of Precedence */
package Precedence;
public class Precedence
{
    public static void main(String[] args)
    {
        int a = 5, b = 10, c = 15, d = 20;
        int x, y, z;
        x = a * b - c;
        y = a - d / b + c;
        prln("a = " +a+ "\tb = "+b);    // Implies(5 * 10) - 15, Not 5 * (10 - 15)
        prln("c = " +c+ "\td = "+d);    // Implies 5 - (20 / 10) + 15
        prln("a * b - c = "+x);
        prln("a - d / b + c = "+y);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}









Share:

About array in Java programme


Array:

Under the name of a common variable, the data stored in memory of the same type stored in memory is called array. The array is the number of variables set in the same type. Array variables can save multiple data in the same name, same type. Array is a derived data type. Before using the variable declaration, it is necessary to declare array variables with data types. The array declaration format is in Java:-


DataType ArrayName[];

ArrayName = new DataType[ ArraySize ];


The above two statements are also written together in this way:-



DataType ArrayName[] = new DataType[ ArraySize ];

Here, DataType is any build-in or custom data type, ArrayName is give programmer any accept name and ArraySize is published of integer any constant name. The name of the variable is an identifier. So valid names of variables can be given. Array size is defined in the third bracket [] of adjacent arrays. Which indicates the number of data in the array variable. This number is called array index and each distinct array of arrays is called an array element separately.

Example :-


char name[] = new char[20];

int roll[] = new int[10];

float mark[] = new float[5];
Share:

Sunday, March 25, 2018

Ternary Operator of Java Programme

/* Example of  Ternary Operator */
package Conditional;
public class Conditional
{
    public static void main(String[] args)
    {
        int a = 10, b = 15;
        int result;
        result = (a > b) ? a : b;
        prln("Maximum of "+a+ " and "+b+ " is: \t"+result);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}












Share:

Various data type of Java Programme

/* Various data type of Java language */



Share:

Assignment Operator of Java Programme

/* Example of Assignment Operator */
package webpractrice;
public class WebPractrice
{
    public static void main(String[] args)
    {
        int a = 10, b = 20;
        prln("a = "+ a + "\t\tb = "+b);
        a += 5;
        b *= 5;
        prln("(a+=5) = "+a+ "\t(b*=5) = " +b);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}









Share:

Bitwise Operator of Java Programming

/* Example of Bitwise Operator */
package Bitwise;
public class Bitwise
{
    public static void main(String[] args)
    {
        int Op1 = 5, Op2 = 10;
        int BitwiseOR, BitwiseAND;
        int LSvalue, RSvalue, RSzerofill;
        BitwiseOR = Op1 | Op2;
        BitwiseAND = Op1 & Op2;
        prln("Bitwise OR of " + Op1 + " and " + Op2 + " is: " +BitwiseOR);
        prln("Bitwise AND of " + Op1 + " and " + Op2 + " is: " +BitwiseAND);
        LSvalue = Op2<<2;
        prln("2 times left shift of " +Op2+ " is: " +LSvalue);
        RSvalue = Op2>>2;
        prln("2 times right shift of " +Op2+ " is: " +RSvalue);
        RSzerofill = Op2>>>2;
        prln("2 times right shift with zero fill of " +Op2+ " is: " +RSzerofill);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}












Share:

Logical operator of Java Programme

/* Example of Logical Operator */
package Logical;
public class Logical
{
    public static void main(String[] args)
    {
        boolean a = true, b = true , c = false, result;
        prln("a = "+a+"\t b = "+b+ "\t c = "+c);
        result = a && b || c;
        prln("a && b || c = "+result);
        result = a || b && c;
        prln("a || b && c = "+result);
        result = a && !a;
        prln("a && !a = "+result);
        result = a || !a;
        prln("a || !a = "+result);
        result = c && !c;
        prln("c && !c = "+result);
        result = c || !c;
        prln("c || !c = "+result);
     
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
 
}












Share:

Arithmetic operator of Java Programme

/* Example of Arithmetic Operator */
package Arithmetic;
public class Arithmetic
{
    public static void main(String[] args)
    {
        int a = 10, b =15, c = 20;
        float d;
        int result;
        d = (float)b/(float)a;
        prln("a = "+a);
        prln("b = "+b);
        prln("c = "+c);
        prln("Division : b/a = "+d);
        result = b % a;
        prln("\n Modulo: b%a = "+result);
        result = a * b + c;
        prln("\n Exprission : a*b+c = "+result);
        result = a + b * c;
        prln("\n Expression : a + b * c = "+result);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}












Share:

Saturday, March 24, 2018

Decremental of Java Programming

/* Example of Post-Decrement & Pre-Decrement */
package Decremental;
public class Decremental
{
    public static void main(String[] args)
    {
        int counter = 1;
        prln("Counter is : " +counter);
        prln("\n--Counter is : "+ --counter);
        prln("\nCounter is : "+counter);
        counter = 1;
        prln("\nCounter is : "+counter);
        prln("\nCounter++ is : "+counter--);
        prln("\nCounter is : "+counter);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}






Share:

Post-Increment & Pre-Increment using in Java

/* Example of Post-Increment& Pre-Increment */
package Incremental;
public class Incremental
{
    public static void main(String[] args)
    {
        int counter = 0;
        prln("Counter is : " +counter);
        prln("\n++Counter is : "+ ++counter);
        prln("\nCounter is : "+counter);
        counter = 0;
        prln("\nCounter is : "+counter);
        prln("\nCounter++ is : "+counter++);
        prln("\nCounter is : "+counter);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}












Share:

CharInput of Java Programme

/* Reading a character from Keyboard */
package CharInput;
import java.io.DataInputStream;

public class CharInput
{
    public static void main(String[] args)
    {
     DataInputStream in = new DataInputStream(System.in);
     char ch;
     try
     {
         pr("Enter a Character : ");
         ch = (char)System.in.read();
         prln("You have enterred : "+ch);
     }
     catch(Exception e){
       
     }
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}








Share:

Cast Operator of Java Programme

/* Example of Cast Operator */
package CastOperator;
public class CastOperator
{
   
    static public void main(String[] args)
    {
        int x = 11, y = 5;
        prln("x = "+x);
        prln("y = "+y);
        prln("Without Casting x/y = " +x/y);
        prln("After Casting x/(float)y = " +x/(float)y);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}




Share:

Monday, March 19, 2018

DataTypes using in Java

/* Various type Primitive data type using */
package DataTypes;
public class DataTypes
{
    static boolean b = true;
    static char c = 'A';
    static byte x = 100;
    static short s = 5000;
    static int i = 3200000;
    static long l = 343489089;
    static float f = 45.90f;
    static double d = 32987.21;
   
    static public void main(String[] args)
    {
        prln(b);
        prln(c);
        prln(x);
        prln(s);
        prln(i);
        prln(l);
        prln(f);
        prln(d);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}





Share:

Sunday, March 18, 2018

String Operation of Java Programme

/* Example of String Operation */
package StringOperation;
public class StringOperation
{
    static public void main(String[] args)
    {
        String S1 , S2;
        S1 = new String("I Love ");
        S2 = new String("Java Programming");
        pr(S1);
        prln(S2);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}



Share:

Character dispaly of Java Programme

/* Assigning Value to Character variables */
package charDispaly;
public class charDispaly
{
    static public void main(String[] args)
    {
        char ch1 = 65;
        char ch2 = 'A';
        prln("Ch1: "+ch1);
        prln("Ch2: "+ch2);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
 
}


Share:

Saturday, March 17, 2018

Boolean Test of Java Programming

/* Working with boolean type Variable */
package BoolenTest;
public class BoolenTest
{
    static public void main(String[] args)
    {
        int x , y;
        boolean z;
        x = 15;
        y = 10;
        prln("x > Y is "+(x > y));
        z = y > x;
       
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}


Share:

Classification of Java


Share:

Blogger templates