there is no mistake, for example Arrays.sort(2, 5) -> in this statement elements at indices 2, 3, 4 will be sorted and 5th index element will not be sorted. so, in short -> Arrays.sort(2(index included), 5(index excluded)).
class Arrays need to import by typing import java,util.Arrays;. but actually intelliJ will tell you whenever you need to import something. It will give red underlined on the class we need to import then you can press alt+enter at the red underlined to import the class you need immediately.
I hope you already got the answer still it's for others who have same question. It's obvious, you'll not get anything, as you've not printed it yet. To print an array do like this: int [] ABC = {10, 2,35,61,2,4} Arrays.sort(ABC); System.out.println(Arrays.toString(ABC)); Now it'll print your array in output
class Arrays need to import by typing import java,util.Arrays;. but actually intelliJ will tell you whenever you need to import something. It will give red underlined on the class we need to import then you can press alt+enter at the red underlined to import the class you need immediately.
In order to run this code create a file called ArraysEx2.java in your IDE Then simply copy and paste this inside import java.util.Scanner; public class ArraysEx2 { //Method public static void userEnterValue() { //Prompt System.out.print("Enter array size as a whole number: "); //creating array of user defined size Scanner keyboard = new Scanner(System.in); int arraySize = keyboard.nextInt(); int array[] = new int[arraySize]; //Prompt System.out.println("Enter the vaules you want stored in the array"); //entering values into the array using input from the user for(int i = 0; i < array.length; i++) { System.out.print("Value " + (i + 1) + ": "); array[i] = keyboard.nextInt(); } keyboard.close(); //displaying the entered values from the user for(int num : array) { System.out.print(num + " "); } System.out.println(); } public static void main(String[] args) { userEnterValue(); } }
Your classes are really great. But the only problem is when you talk,i feel like you are shouting continuosly. It would be really helpful if you spoke in a calm voice.Thank you.
This gives me so much hope for my kid. Anyways i better enhance myself by looking for help before he turns 4. He is 2 next month and the mother is preventin me to see him just for the sake of hurting me. We are in a law pocess now but it takes time. This should be priority in terms of law processes.
I loves 🤩 your video the audio is not important but how you teaching is important
Thanks for your lesson, it was helpful for me.
interested👍
thanks so match your lesson is very clear everyone can understand on it i hop to mack all the lesson so cleare thanks thanks
Amazing video sir
thanks for lesson it was very helpfull for me
Perfect
Nyc explanation
is there any mistake when u says that there when sort (from index )to (to index)i dont get logic abt it...ow there is index-1 for(from index).....
there is no mistake, for example Arrays.sort(2, 5) -> in this statement elements at indices 2, 3, 4 will be sorted and 5th index element will not be sorted.
so, in short -> Arrays.sort(2(index included), 5(index excluded)).
Sir would I know which class we have to import and which class already imported?
Sir I am really confused about it 😕
import java.util.Arrays ;
class Arrays need to import by typing import java,util.Arrays;. but actually intelliJ will tell you whenever you need to import something. It will give red underlined on the class we need to import then you can press alt+enter at the red underlined to import the class you need immediately.
import java.util.*;
@@mostafamarwanmostafa9975 hii
int ABC [] = {10,2,35,61,2,4};
Arrays.sort(ABC);
!
I have this code, but the output is empty, what is the reason?
Syntax is
Int[] ABC ={ 1,2,6,6,};
{
int[] ABC= {10,3,35,61,2,4};
Arrays.sort(ABC);
for(int i=0 ; i
@@aditimondal9914 thank you
@@parthpandya2909 both are correct. You can write either of the way.
I hope you already got the answer still it's for others who have same question.
It's obvious, you'll not get anything, as you've not printed it yet. To print an array do like this:
int [] ABC = {10, 2,35,61,2,4}
Arrays.sort(ABC);
System.out.println(Arrays.toString(ABC));
Now it'll print your array in output
Is there any requirement of importing the array class or not?
Sir plz reply 😕
class Arrays need to import by typing import java,util.Arrays;. but actually intelliJ will tell you whenever you need to import something. It will give red underlined on the class we need to import then you can press alt+enter at the red underlined to import the class you need immediately.
@@matthewsiahaan2505 thank you 🙏
Can some explain to me why do we add 1 to the insertionIndex if the element is not found?
is it possible to combine all array class in 1 program ?
yes
Sort array containing object using compareTo in next video..!
In a c++ programmer and I'm surprised. You can do this with high level languages without making your own methods!?
Are there power point documents for subscribers on the site ?
Is it the ASCII code or the Unicode, cause unicode it sounds like unicorn
Unicode is same as ASCII
Sir.... how enter the values into the array using input from the user
In order to run this code create a file called ArraysEx2.java in your IDE
Then simply copy and paste this inside
import java.util.Scanner;
public class ArraysEx2 {
//Method
public static void userEnterValue() {
//Prompt
System.out.print("Enter array size as a whole number: ");
//creating array of user defined size
Scanner keyboard = new Scanner(System.in);
int arraySize = keyboard.nextInt();
int array[] = new int[arraySize];
//Prompt
System.out.println("Enter the vaules you want stored in the array");
//entering values into the array using input from the user
for(int i = 0; i < array.length; i++) {
System.out.print("Value " + (i + 1) + ": ");
array[i] = keyboard.nextInt();
}
keyboard.close();
//displaying the entered values from the user
for(int num : array) {
System.out.print(num + " ");
}
System.out.println();
}
public static void main(String[] args) {
userEnterValue();
}
}
Using for loop.
for(int i; i>array.length(); i++) {
int[i] = sc.nextInt();
}
to print use Array.toString();
Your classes are really great. But the only problem is when you talk,i feel like you are shouting continuosly. It would be really helpful if you spoke in a calm voice.Thank you.
its just in your head
This gives me so much hope for my kid. Anyways i better enhance myself by looking for help before he turns 4. He is 2 next month and the mother is preventin me to see him just for the sake of hurting me. We are in a law pocess now but it takes time. This should be priority in terms of law processes.
Sir launch the videos of java8.0 in Hindi