Java Bangla Tutorials 76 : Array | Matrix Part-1

preview_player
Показать описание
➡️ In this video, I will show how to create a matrix with the help of a 2d array.
⭐️ Video Contents ⭐️
⌨️ (00:00) Intro
⌨️ (00:11) Two-dimensional array
⌨️ (10:11) outro

🛑 Web development? Checkout following playlists :

🛑 Programming languages? Check out the following playlists:

🛑 Android development? Check out the following playlists:

🛑 HSC Students? Are you worried about ICT? I have created 377 videos for you. check out the following playlists-

🛑 CSE Students? Checkout following playlists :

🛑 MS Office? Trying to learn MS office to improve your skill? Checkout following playlists :

#java #anisul_islam #java_bangla_tutorial #web_development #bangla_web_development #andorid #javaprogramming #javatutorial #bangla_tutorial #java_anisul_islam
Рекомендации по теме
Комментарии
Автор

ভাই খুব বিপদে ছিলাম জাভা নিয়ে
সেমিস্টার প্রায় শেষ ।এখন মাত্র ১০ দিনের মত বাকি।এত তারাতারি কিভাবে কি করব বুঝতেসিলাম না।আপনার ভিডিওগুলো দেখে মনে হচ্ছে আল্লাহর রহমতে অনেক কিছুই পারব
ধন্যবাদ ভাই

marufurrahman
Автор

Thanku vaia eyrokom video upohar deoyar jonno, Allah apnar mongol korun(Amin)

monirhossen
Автор

Thank you for this important topic, sir.

md.moyeenuddinmostofajamal
Автор

package day2;

import java.util.Scanner;

public class Matrix {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int[][] A = new int[2][3];
int[][] B = new int[2][3];

System.out.print("Enter Elements for A : ");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
A[row][col] = input.nextInt();
}
}
System.out.print("Enter Elements for B : ");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
B[row][col] = input.nextInt();
}
}
System.out.println("Matrix A is : ");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.print(" " + A[row][col]);
}
System.out.println();
}

System.out.println("Matrix B is : ");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.print(" " + B[row][col]);
}
System.out.println();
}

}
}

tomabanik
Автор

Take an array of 10 elements. Split it into middle and store the elements in two dfferent arrays. please explain this problem please sir

sanjoyroy
Автор

apnar video gulo thke kichu sikte parlam
amr akta problem hoise sir amar ai code tar formate specifier show kortece


package array;

import java.util.Scanner;

public class array_3 {

public static void main(String[] args) {

Scanner input = new Scanner (System.in);

int[][] A = new int[2][3];



System.out.println("Enter elements for a matrix");
for (int row = 0; row < 2; row++) {

for (int col = 0; col < 3; col++) {

System.out.printf("A[%d][%d]=", row, col);
A[row][col] = input.nextInt();
}

}


System.out.println("A = ");
for (int row = 0; row < 2; row++) {

for (int col = 0; col < 3; col++) {

System.out.print(" "+A[row][col]);

}

}


}

}

bgb-player
Автор

What's the shortcut for creating for loops brother? and love your videos. Thank you!

KingBangVEVO
Автор

.ArrayIndexOutOfBoundsException, i coded as same as you did but this exception throws every time. can you tell me how to solve? I've searched everywhere but can't find the solution. Here is the code where i can't take array elements input:
//import java.lang.reflect.Array;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
int [][]num=new int[2][3];
Scanner in=new Scanner(System.in);
int i, j;
for(i=0; i<2; i++){
for( j=0; j<3; j++){
num[2][3]=in.nextInt();
}

}
}
}

yasminsultanaemu
Автор

package classofarray;

import java.util.Scanner;

public class ArrayMatrixOne {

public static void main(String[] args) {
int[][] A = new int[2][3];
int[][] B = new int[2][3];
Scanner input = new Scanner(System.in);
System.out.println("Enter number for A matrix : ");

int row, col;
for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.printf("A[%d][%d] = ", row, col);
A[row][col] = input.nextInt();

}
}
System.out.println("A = ");

for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.print(" " + A[row][col]);

}
System.out.println("");
}
System.out.println("Enter number for B matrix : ");
for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.printf("B[%d][%d] = ", row, col);
B[row][col] = input.nextInt();

}
}
System.out.println("B = ");

for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.print(" " + B[row][col]);

}
System.out.println("");

}

}

}

elorabarua
Автор

package arrayPackage;

import java.util.Scanner;

public class Matrix {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

// getting input for row and col number;
System.out.print("How many Row You Want = ");
int r = input.nextInt();
System.out.print("How many Column You Want = ");
int c = input.nextInt();

// getting input for first array
int [] [] arr1 = new int [r] [c];
System.out.println("\nEnter First Array Value\n");

for (int row = 0; row < r; row++) {
for (int col = 0; col < c; col++) {
System.out.print("Enter " + row + " Row " + col + " Col Value = ");
arr1 [row] [col] = input.nextInt();
}
System.out.println();
}

// getting input for second array
int [] [] arr2 = new int [r] [c];
System.out.println("\nEnter Second Array Value\n");

for (int row = 0; row < r; row++) {
for (int col = 0; col < c; col++) {
System.out.print("Enter " + row + " Row " + col + " Col Value = ");
arr2 [row] [col] = input.nextInt();
}
System.out.println();
}


// printing first array
System.out.println("First Array is = ");
for (int row = 0; row < r; row++) {
for (int col = 0; col < c; col++) {
System.out.print(" " + arr1[row][col]);
}
System.out.println();
}

// printing second array
System.out.println("Second Array is = ");
for (int row = 0; row < r; row++) {
for (int col = 0; col < c; col++) {
System.out.print(" " + arr2[row][col]);
}
System.out.println();
}
}
}

hasansiam
Автор

package Array1;

import java.util.Scanner;

public class Array2DDemo {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n, m, o, p;
System.out.print("Enter array length for row: ");
n = input.nextInt();
System.out.print("Enter array length for col: ");
m = input.nextInt();

int[][] A = new int[n][m];

System.out.println("");
System.out.print("Enter array length for row1: ");
o = input.nextInt();
System.out.print("Enter array length for col1: ");
p = input.nextInt();

int[][] B = new int[o][p];

System.out.println("");
System.out.println("Enter elements for A metrix:");
for (int row = 0; row < n; row++) {
for (int col = 0; col < m; col++) {
System.out.printf("A[%d][%d] = ", row, col);
A[row][col] = input.nextInt();
}
}

System.out.println("Enter elements for B metrix:");
for (int row1 = 0; row1 < o; row1++) {
for (int col1 = 0; col1 < p; col1++) {
System.out.printf("B[%d][%d] = ", row1, col1);
B[row1][col1] = input.nextInt();
}
}
System.out.println("");
System.out.println("A: ");
for (int row = 0; row < n; row++) {
for (int col = 0; col < m; col++) {
System.out.print(" "+A[row][col]);
}
System.out.println();
}
System.out.println("B: ");
for (int row1 = 0; row1 < o; row1++) {
for (int col1 = 0; col1 < p; col1++) {
System.out.print(" "+B[row1][col1]);
}
System.out.println();
}

}
}

shakilahmed
Автор

import java.util.Scanner;

//Matrix
public class Tutorial_18 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int[][]A=new int[2][3];
int[][]B=new int[2][3];
System.out.println("Enter number for A: ");
for (int row=0;row<2;row++){
for (int col=0;col<3;col++){
");
A[row][col]=input.nextInt();
}
}System.out.println("Enter number for B: ");
for (int row=0;row<2;row++){
for (int col=0;col<3;col++){
");
B[row][col]=input.nextInt();
}
}

for (int row=0;row<2;row++){
for (int col=0;col<3;col++){
System.out.print(" "+A[row][col]);
}System.out.println();
}

for (int row=0;row<2;row++){
for (int col=0;col<3;col++){
System.out.print(" "+B[row][col]);
}System.out.println();
}
}
}

BelalHossain-fu
Автор

package trial;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

int[][] a;
a = new int[2][3];

for(int i=0;i<2;i++)
{
for(int j=0;j<3;j++)
{
");
a[i][j]= sc.nextInt();
}
}
for(int i=0;i<2;i++)
{
for(int j=0;j<3;j++)
{
System.out.print(" "+a[i][j]);
}
System.out.println();
}
}
}

higurudematsu
Автор

package hello.java;

import java.util.Scanner;


public class {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int [][]A = new int [2][3];
int [][]B = new int [2][3];


//Getting Input for A Matrix
System.out.println("Enter elements for A Matrix: ");

for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.printf("A[%d][%d] = ", row, col); //does not work
A[row][col] = input.nextInt();

}

}
//Getting Input for B Matrix
System.out.println("Enter elements for B Matrix: ");

for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.printf("B[%d][%d] = ", row, col); //does't work
B[row][col] = input.nextInt();

}

}
//Printng A Matrix
System.out.println("Matrix A is:");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.print(" "+A[row][col]);

}
System.out.println("");
}
//Printng B Matrix
System.out.println("Matrix B is:");
for (int row = 0; row < 2; row++) {
for (int col = 0; col < 3; col++) {
System.out.print(" "+B[row][col]);

}
System.out.println("");
}
}

}
A[ 0] [ 0]=1
A [ 0] [ 1] =2
এরকম করে আউটপুট না আসার কারণ কি/can you help me?

md.tajulislampradhan
welcome to shbcf.ru