Java Tutorial: Practice Questions on Arrays in Java

preview_player
Показать описание
Java Arrays Practice Set: In this video, we will see few questions on Java Arrays. We will see some good concepts like how to reverse an array, how to find maximum element in an array etc.

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

This is actually funn, Watching this video at 2 AM, Understanding something new in the silence of night, I watched your 2D array video 4 times before moving ahead and it turns out that i understood array but was having difficulty with understanding nested loops, i needed to watch some other videos about nested loops to understand them, i am not complaining about that, this playlist is awesome, a single person cannot handle everything so perfectly but you still made it perfect!! Thankyou for this amazing Playlist and listing it on the internet for free, You are not teaching a youtube user, you are shaping the Indian future!

realheckertrustmebro
Автор

Clearing the doubts in Q5 . Many people had this confusion.. For reversing the array.

brother you have to reverse the array. Not just u have to print the values in reverse.
think on it once. Earlier I also used to think the same way. But got cleared.
In the method explained by harry bhai he is trying to reverse the actual array and that is what the question is about. The question is not to print the array in reverse order.

vkumar
Автор

// Question 7 - Finding out the minimum element of Array
int[] arr2 = {-1, -4, 53, -32, -6, 92, 10, -372};
int min = Integer.MAX_VALUE;
for (int elem: arr2) {
if (elem < min) {
min = elem;
}
}
System.out.println(min);

abulkalamasif
Автор

System.out.println("Problem number 8");
int min = Integer.MAX_VALUE;

for (int i : array) {
if (i < min) {
min = i;
}

}
System.out.println(min);

Thanks for this amazing course

vaibhavnayak
Автор

Great work bruh... Though I am not learning java right now but i saw your notification and came here to support your video✌😁

aishwarya
Автор

It's just fabulous. I'm a computer science student but when I read the array concept in the college it was not as clear and understanding as this videos. Thank you Harry sir for giving us such fabulous free course video!!!!

soumyashreemohapatra
Автор

Practice set is the heart of your teachings, to grasp every concept.

ankitasingh
Автор

i started learning from apna college untill i found you they are good in theoretical part but for better understanding it needded practical knowledge and thats what u r giving us thanks harry bhaiya u r doing great work for everyone

zeeshanali
Автор

These practice problems make concepts much more clear. Thank you so much Harry sir!

KajalSingh-xgjp
Автор

For finding minimum element code


int [ ]arr={12, 849, 0, 93, 01, 87};
int i;
int min=arr[0];
for(i=0;i<arr.length;i++)
{
if(min<arr[i])
{
min=arr[i];
}
}

System.out.println(min);




It doesn't matter that I start from 0 or 1

Thanks nice reaching
😊😊

Rohit-
Автор

This is the only channel whose video I watch in full screen!!😁

Mayank-yznn
Автор

26:17 we can use the - - from the length to 0 then this will be solve i have example
int [] a = {1, 2, 3, 4};
// for (int i = a.length-1; i>-1; i--)
// {
// System.out.println("Reverse Number is = " + a[i]);
// }

harshgaming-cezl
Автор

//To find minimum element in an array
public class Main
{
public static void main(String[] args) {
int [] arr={1, 8, 4, 9, 23, 2, -3, 5};
int min=arr[0];
for(int element: arr){
if(element<min){
min=element;
}
}
System.out.println("the minimum element is "+min);
}
}

rock
Автор

29:03 instead of going through broader way, we can reverse an array by this way

int [] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int l = arr.length;
for(int i=l-1;i>=0;i--)
{
System.out.print(arr[i] +" ");
}

above program i think is simplest way to reverse an array

Sameer
Автор

Question number 7 :
public class CWH_29_Practice_Set_6 {
public static void main(String[] args){
int [] arr = {1, 2, 25, 56, 78, 789};
int min = Integer.MAX_VALUE;
for(int element: arr){
if(element < min){
min = element;
}
}
System.out.println("Minimum element in the array: "+min);
}
}
Output :

Minimum element in the array: 1
42:46 Yes Sir understanding the concepts clearly. Thank you very much!

hitarthshah
Автор

this is one of the toughest video in this playlist (till this video)

awesomeadarsh
Автор

the loops are really really hard atleast for me as a beginner and i am unable to build logic in most of these question but i still think the problem will be solved sooner or later if i will keep following your videos so *THANKS A LOT* for putting this great effort

vishalvishu
Автор

40:40 putting max=arr[0] instead of max=0, would be better. It will work for both negative and positive integers(all integers) in the array. And if the array is empty then we could put if else statement to check if length of array is 0 or not.

toshitsingh
Автор

float [] num = {12.5f, 13.8f, 101.02f, 99.99f, 78.7f};
float store = 0;

for(int i =0; i<num.length; i++){
store = store + num[i];
}
System.out.println("the sum is -> " + store );

Luffy_
Автор

35:12 so tough apne reverse ka program bhot tough way mei bta diya jb k bhot easy logic h ye khud quiz mei btaya tha aap array k

arshuarshad