JAVA | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
3rd Apr 2024, 8:56 PM
Qutaba Qais Mahmood
Qutaba Qais  Mahmood - avatar
3 Answers
+ 5
Pay attention to your spelling you need charAt(). You also should lower case the first letter of your variable: name instead of Name - but that won't give an error most of the time.
3rd Apr 2024, 9:50 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Write below code for correct output public class Program { public static void main(String[] args){ String Name = "Ali"; for(int i=0 ;i<Name.length();i++){ if(Name.charAt(i)=='l'){ System.out.println("true"); }else{ System.out.println("false"); } } } }
5th Apr 2024, 7:53 AM
Kailash Yandrapu
0
thanks
5th Apr 2024, 10:12 PM
Qutaba Qais Mahmood
Qutaba Qais  Mahmood - avatar