xception in thread "main" java.lang.Error: Unresolved compilation problem: The method isBlank() is undefined for the type String at Main.main(Main.java:12)
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
import java.util.Scanner; /*Brandon (Insert last name here) *March 28, 2021 *Do While Loops */ public class DoWhileLoops { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String name = ""; while (name.isBlank()) { System.out.println("Enter you name"); System.out.print("> "); name = scan.nextLine(); }//while name is blank these lines of code will occur System.out.println("Hello there " + name + ", welcome!"); do { System.out.println("Enter you name"); System.out.print("> "); name = scan.nextLine(); } while (name.isBlank());//does these lines of code once always and will repeat it until while statement is false System.out.println("Hello there " + name + ", welcome!"); }//end of main }//end of class
Thank you , anyone know any real life examples of times where I'd use a do loop ? I'm a bit of a visual learner so if I get an example I'll get a clearer picture of when it makes sense to use a while loop and when to use a do loop
you could as a user for their age, and lets say you have a condition to where the age has to be from 1 to however old you want the max age to be. Then the user inputs a negative age or an age that is for example 999. You then could print an error message and ask the user to re-enter their age.
Do while loop in real life is like we have to graduate after completing our school and we get admission in any courses without any future plan ( for example :- cs engineering ) and after' completing our graduation course we think we have done our graduation in right stream or not ( first we execute the code (" at least one time ") and after that we checked the condition ) And while loop like first plan what to do in future then select the particular stream according to your plan ( first check the condition and then execute if condition is true ) 😁
hello bro i was running this code but i am getting error at .isBlank as follow : Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method isBlank() is undefined for the type String at peactice.While_loop.main(While_loop.java:13) what should i do any one know about it pls tell
broooooo what if i want a input as integer value and the user is skipping the input , what should use in that case i tried Integer wrapper class but it doesn't work
I tried this using the JOptionPane import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { String name = ""; while (name.isEmpty()) { JOptionPane.showInputDialog("Enter your name"); }
Hi Bro! I'm having a problem with this code, it's not running well on NetBeans 12.4 and it's driving me crazy!! System.out.print inside while loop is printing nothing, it works if I use System.out.println but the issue is that it goes to another line and I want to make it work as you do. PS you're the best!
hey bro can you please help me i created a game in java a rock paper scissors one and its continuously executing i want it to execute only five times and it should stop can you please help help how to do it please reply brooooooooooooooooooooooo.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// while loop = executes a block of code as long as a it's condition remains true
Scanner scanner = new Scanner(System.in);
String name = "";
while(name.isBlank()) {
System.out.print("Enter your name: ");
name = scanner.nextLine();
}
System.out.println("Welcome "+name);
}
}
xception in thread "main" java.lang.Error: Unresolved compilation problem:
The method isBlank() is undefined for the type String
at Main.main(Main.java:12)
what is means?
@@ianamihai3233 It's Just because the isBlank() is supported after the JDK Version 11 & out might have older version of it.
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
it's the best course I have ever seen!
Great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much 💜💜💜💜
OUR HERO !!(Who knows java)
Thank you for usefull inputs to my Java jorney.
Tysm, you helped me learn java basics
Understood while loop. 12th. Thank you, ma Bro Sensei!
import java.util.Scanner;
/*Brandon (Insert last name here)
*March 28, 2021
*Do While Loops
*/
public class DoWhileLoops {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String name = "";
while (name.isBlank()) {
System.out.println("Enter you name");
System.out.print("> ");
name = scan.nextLine();
}//while name is blank these lines of code will occur
System.out.println("Hello there " + name + ", welcome!");
do {
System.out.println("Enter you name");
System.out.print("> ");
name = scan.nextLine();
} while (name.isBlank());//does these lines of code once always and will repeat it until while statement is false
System.out.println("Hello there " + name + ", welcome!");
}//end of main
}//end of class
Nice another way of looking at the do while or loops Thanks
Nice👍😊😊😊 it was just amazing🤩😍😍
thanks for sharing x
God Bless you Bro +10
Thank you so much again 💙💙💙💙💙
you are amazing!
Thank you , anyone know any real life examples of times where I'd use a do loop ? I'm a bit of a visual learner so if I get an example I'll get a clearer picture of when it makes sense to use a while loop and when to use a do loop
you could as a user for their age, and lets say you have a condition to where the age has to be from 1 to however old you want the max age to be. Then the user inputs a negative age or an age that is for example 999. You then could print an error message and ask the user to re-enter their age.
Do while loop in real life is like we have to graduate after completing our school and we get admission in any courses without any future plan ( for example :- cs engineering ) and after' completing our graduation course we think we have done our graduation in right stream or not ( first we execute the code (" at least one time ") and after that we checked the condition )
And while loop like first plan what to do in future then select the particular stream according to your plan ( first check the condition and then execute if condition is true )
😁
@@manglooeditz7751help i am struck in a loop😂
Thanks Bro ❤
Love your videos
Very educational video
best teacher everrrr
im glad your channel has grown bro can you also create a tutorial about javascript thank you
This is a like before watching the video.
ty bro
thx 4 vid bro !
Thanks bro
Thanks, Bro 06/01/2024
i copied the same code and it shows me:" cannot find symbol
symbol: method isBlank()
location: variable name of type String "
any help ?
do isEmpty() instead of isBlank()
@@SushiEater44 thanks bro
@@SushiEater44 thanks it's works
@@مجهول-ن5ع7ن no need to thank me bro, good luck with your future journey mate
@@SushiEater44 🤍
Thanks
do-while loop 2:53
THANK YOU
thanks😁
❤️❤️❤️
cool😄
Thanks!
thank u bro
thanks
tybro
Nice!
Thanks, Bro! ☕
Nice.
hello bro i was running this code but i am getting error at .isBlank as follow :
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method isBlank() is undefined for the type String
at peactice.While_loop.main(While_loop.java:13)
what should i do any one know about it pls tell
same here what i do is i replace it to name.isEmpty and it works
@@johnglenndeleon3113 thanks it's works
thanks bro
Awesome
thanks!
BRO IS A GOD SEND
thx bro
what if I want to do this with an integer? so instead of the name we do it for like age or smth
How do I do that with numbers?
learnt thx
❤❤❤
❤️👌🙌🙌
broooooo what if i want a input as integer value and the user is skipping the input , what should use in that case i tried Integer wrapper class but it doesn't work
i am new bro i want to ask a question why we use scanner becz you can not use it in previous for loop lecture
good
Bro has the matching name for his channel. "BRO"
Nice
while(subscirbedToBro(true))
{
System.out.println("So bad");
}
System.out.println("Welcome to the bros");
Ο βρόχος επανάληψης while και do while.
the best
awesome
THANK!
Cool
ur cool
Nice vid bro
I didn't understand do while loop clearly. It working same .
👌
I tried this using the JOptionPane
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
String name = "";
while (name.isEmpty()) {
JOptionPane.showInputDialog("Enter your name");
}
JOptionPane.showMessageDialog(null, "Hello " + name);
}
}
but the "Enter your name" dialoge keeps on looping even I entered a name... any help or tricks?
Maybe JOptionPane doesn't work withe While... Idk.
do this while you follow along
prayer
👍😇
comment for algorithmm
Thank you Bro
hi
BROOOOOOOOOOOOO
Hi Bro! I'm having a problem with this code, it's not running well on NetBeans 12.4 and it's driving me crazy!! System.out.print inside while loop is printing nothing, it works if I use System.out.println but the issue is that it goes to another line and I want to make it work as you do. PS you're the best!
looking forward
i do have another problem regardless, the .isBlank it does not recognized by the NetBeans version 12.6
@@humbertovalle6837 I had the same problem. Using .isEmpty seems to be what most people use on NetBeans
23,400 views and only 59 comments >:(
Bro is bro
Allah oh akbar
hi bro
good soup
hey bro can you please help me i created a game in java a rock paper scissors one and its continuously executing i want it to execute only five times and it should stop can you please help help how to do it please reply brooooooooooooooooooooooo.
Bro I need help can U help me is easy for U please replay
vedio -12
dude help me i got infinite loop :(
loooooooooooooooooooooooooooooooooooooooooooooooop
man
"Video 12"
CRnh
15
Keep studying
comment
Comment 12
i was here
iyi
🙂
ty bro
Thanks
nice
ty bro
ty bro