Thanx so much John! I'm on my third week for Java dev. Yesterday I cried in class, and yelled; I just don't understand anything! Today I'm back up on the horse. My teacher guided me to your chanel. XOXO thai
buddy you're doing a great job , i really want to thankyou for this, could you plz make a video about oops but in advance way, but each of the four concept should be explained in the separate video
i have a question at around 11:05, I saw you assigned floatAge the value inside of the try block, but declared it outside of it. Is this necessary, or could you declare floatAge and initialize both inside of the try block?
If you declare and initialize the floatAge variable inside of the try block you will only be able to use it inside(!) of the try block, as it only exists within that block. So if you are looking to, for example print out the value of floatAge later on (like John did in the video), you will have to declare and initialize it outside of the try block.
In chapter 8 I was taught something called casting (not working with the scanner class). Are both what I mentioned and what you tought us equaly valid or is there a difference?
Love all your videos... You're truly awesome 👍💪 Please could you do a video on the different types of ways to get user inputs? Be keeping an eye out for this ✊✊
Hi John. I have a strange issue. I expect code below to allow me to enter 3 string elements from keyboard but unfortunately after entering two strings, immediately I see the output of myStrings array which looks odd: [FirstString, ,SecondString]. There is an empty element between myStrings[0] and myStrings[2]? Why? It is expecting that each scanner.nextLine() will consume the new line including ; but the situation is not as such? import java.util.Arrays; import java.util.Scanner; public class Main { private static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { String[] myStrings = getStrings(3); System.out.println(Arrays.toString(myStrings)); } public static String[] getStrings(int number){ System.out.println("Enter "+number+" strings "); String[] values = new String[number]; for (int i=0;i< values.length;i++){ values[i]=scanner.nextLine(); } return values; } }
My real output is "C:\Program Files\Amazon Corretto\jdk11.0.15_9\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=49409:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\ARCHITECT\IdeaProjects\ArrayVsArrayList\out\production\ArrayVsArrayList Main Enter 3 strings. First Second [First, , Second] Process finished with exit code 0
Another code peace which is odd too. The problem is with scanner.nextLine() but why? import java.util.Arrays; import java.util.Scanner; public class Main { private static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { String[] myStrings = new String[3]; myStrings[0]=scanner.nextLine(); myStrings[1]=scanner.nextLine(); myStrings[2]=scanner.nextLine(); System.out.println("End entering. But problem is still there"); System.out.println(Arrays.asList(myStrings)); } }
Thanx so much John! I'm on my third week for Java dev. Yesterday I cried in class, and yelled; I just don't understand anything! Today I'm back up on the horse. My teacher guided me to your chanel. XOXO thai
You are so amazing, Please continue making more videos on Java. Will be greatly appreciated!
Super helpful and easy to understand!
Im surprised so many people make videos or go on forums despite how wrong they are most of the time! its really amazing
Ty so much this helped me print some basic code.
Cheese sanwidch is not garbage.
Video is very helpful!
love you john, I really do
Thank you for this very useful video!
Great explanation. Thank you.
thanks a lot John !
Wao you made it so simple . Thanks 🙌
Great explanation, thanks
It's a veeery good tutorial, thank you!
great job sir!
Johns the best!
buddy you're doing a great job , i really want to thankyou for this, could you plz make a video about oops but in advance way, but each of the four concept should be explained in the separate video
love your videos
I would like smaller and easier tutorials like constructor tutorial you made that was pretty good
Great method how to teach
Respect from Afghanistan 🇦🇫…
nice and helpfull thank you bro.
At 6:36 , how did you delete the whole line so quickly without selecting the characters ? What is that keyboard shortcut ?
Control + D, works in many programs. One of my most used shortcuts for sure!
Thanks boss 👍
i have a question at around 11:05, I saw you assigned floatAge the value inside of the try block, but declared it outside of it. Is this necessary, or could you declare floatAge and initialize both inside of the try block?
If you declare and initialize the floatAge variable inside of the try block you will only be able to use it inside(!) of the try block, as it only exists within that block.
So if you are looking to, for example print out the value of floatAge later on (like John did in the video), you will have to declare and initialize it outside of the try block.
@@piikayy7511 oh ok that makes sense thank you
Thank You
great video
In chapter 8 I was taught something called casting (not working with the scanner class). Are both what I mentioned and what you tought us equaly valid or is there a difference?
Love all your videos...
You're truly awesome 👍💪
Please could you do a video on the different types of ways to get user inputs?
Be keeping an eye out for this
✊✊
Scanner and BufferedReader
You're awesome!
I can't make a cheese sandwich into a float, but I can make ice cream into a float by pouring soda on it.
Put the sandwich in some soda
thaanks alot
How to make the scanner inputs are beside the question??
Can you explain why you can’t reopen a Scanner after you call close?
Ty sir
Great video , but can I have a question ? Why my scanner nextFloat read float from keyboard with comma instead of dot ? , can you help me . Thanks
Your scanner is high
depends on your windows keyboard language probably
6:11 - Suitably creeped out
Hi John. I have a strange issue. I expect code below to allow me to enter 3 string elements from keyboard but unfortunately after entering two strings, immediately I see the output of myStrings array which looks odd: [FirstString, ,SecondString]. There is an empty element between myStrings[0] and myStrings[2]? Why? It is expecting that each scanner.nextLine() will consume the new line including
; but the situation is not as such?
import java.util.Arrays;
import java.util.Scanner;
public class Main {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
String[] myStrings = getStrings(3);
System.out.println(Arrays.toString(myStrings));
}
public static String[] getStrings(int number){
System.out.println("Enter "+number+" strings
");
String[] values = new String[number];
for (int i=0;i< values.length;i++){
values[i]=scanner.nextLine();
}
return values;
}
}
My real output is "C:\Program Files\Amazon Corretto\jdk11.0.15_9\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=49409:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\ARCHITECT\IdeaProjects\ArrayVsArrayList\out\production\ArrayVsArrayList Main
Enter 3 strings.
First
Second
[First, , Second]
Process finished with exit code 0
Another code peace which is odd too. The problem is with scanner.nextLine() but why?
import java.util.Arrays;
import java.util.Scanner;
public class Main {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
String[] myStrings = new String[3];
myStrings[0]=scanner.nextLine();
myStrings[1]=scanner.nextLine();
myStrings[2]=scanner.nextLine();
System.out.println("End entering. But problem is still there");
System.out.println(Arrays.asList(myStrings));
}
}
So we're just ignoring his shoe size? (Great video)
13:38. Is this bad practise to evaluate booleans as booleanName == false
How about (!booleanName) in your example.
What happened in while condition i didn't get
I prefer a bang instead of "== false".
Jhonny sins 😂😂 brother im joking
Thanks for the video mate but are we gonna ignore this man having a size 14 foot? 💀
With that shoe size, you ever play any basketball??
Not since 8th grade or so 🫤
Java is really verbose
But i dont wanna be a good boy scout...im a girl