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:

Blogger templates