User input in 2D array | Program for taking user input in 2D array java

preview_player
Показать описание
User input in 2D array | Program for taking user input in 2D array java.

In this video, I will show you the program for taking user input in a 2D array in java.
For any doubts, tell me in the comments.

Google drive link for code: -

If you are running this program in online compilers then change the class name to which the class name is already written on that compiler tab.

Other Playlists:-

Java Programs for Beginners

Programming Fundamentals And OOPS

Array (1D & 2D) Programs In Java

String Programs in Java

Important Algorithms

Software installations in windows

TCS Placement Resources

Infosys Placement Resources

Accenture Placement Resources

Star and Number Patterns

Other social links:-

#java #javaprogramming #javatutorialforbeginners #javatutorial #javatutorialsforbeginners
Рекомендации по теме
Комментарии
Автор

Thank you so much sir . i shall remain ever obliged to you

sukanshigarg
Автор

nice explanation
try to use white theme for videos it will be good see

suneelkumar
Автор

Bro how to save a string "welcome"as a char in 2d array lik" w-a[0] [0] " and so on..

Tamilgamesandtech
Автор

for the second for loop why do we write j<a[0].length instead of j< a.length

laxayaboi
Автор

if using r in the i for-loop and c in the j for-loop produces the same result, what is the purpose of "a.length" or "a[0].length"?
I am new to the language Java and am genuinely curious. Great video though, very informative.


import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int r = scanner.nextInt();
int c = scanner.nextInt();
int[][] array = new int[r][c];
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
array[i][j] = scanner.nextInt();
}
}

for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{

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

Ryderdie
Автор

What does the "a" represent?

gervinho