All my interest in Java is because of you. I can't thank you enough for all that you have done for us!! 👏
@909praveen3 жыл бұрын
Thanks Naveen for the video . For the assessment we just have to remove not symbol from if(String.valueOf(c).is blank()).
@surabhibn5412 жыл бұрын
Your approach is really so easy to understand and you solve the program in most efficient way too Thank you so much...
@shashikumarkondoju78083 жыл бұрын
Thankyou sir the way you explained awesome..it's makes every one to easy understand... For only spaces count we use instead of not if condition if(String.valueOf(ch).isBank())
@antarabanerjee73143 жыл бұрын
Thanks for the explanation Naveen. It's because of you, yesterday I cracked one more interview!
@naveenautomationlabs3 жыл бұрын
Many congratulations 👍
@antarabanerjee73143 жыл бұрын
@@naveenautomationlabs thank you so much!
@cngramesh4 ай бұрын
For checking space, replace "a" with space : String str = "this is a java programming"; int result = str.length()- str.replaceAll("a", "").length(); System.out.println(result);
@lavanya.ds06573 жыл бұрын
Thank you souch for sharing this Naveen, this is mandatory question asked in many interviews for experienced candidates
@anilds2631 Жыл бұрын
solution for counting space int count=0; for(char ch:name.toCharArray()) { if(ch==' ') { count++; } } System.out.println("******************"); System.out.println(count);
@somrajyadav24462 жыл бұрын
Thank you Naveen!! God bless you 🙏
@NagarajuN-ev3pl7 ай бұрын
Hi NAVEEN, Good day! The same program I was facing in the technical round and I wrote and explained to the interviewer. I cracked and cleared the first round as well. Thank you, please post more mock interviews. Thanks a lot..
@anilds2631 Жыл бұрын
Solution for only space we need to take count of string and replaceall method int n=name.length()-name.replaceAll(" ", "").length(); System.out.println("spaceCount"); System.out.println(n);
@ParamjitKaur-jo2sz2 жыл бұрын
To count only spaces, we will remove NOT from condition like below if(String.valueOf(c).isBlank())
@MrAshu583 жыл бұрын
I am well versed in Python, Should I learn Java as well?
@naveenautomationlabs3 жыл бұрын
Yes if you trying for Selenium. Selenium with java is the most demanding as compared to other language bindings.
@thatsdeep70582 жыл бұрын
YOU'RE THE MAN!!, THANK YOU!!!!!!!!!!!! but why u had to test ur code for 10 min lol
@aayushpatel33603 жыл бұрын
Best approach
@arunkumar-ke3km4 ай бұрын
veryuseful video,
@13success662 жыл бұрын
Beautiful explanation
@ShashiBhushanSrivastava0013 жыл бұрын
Thanks Naveen.
@ashuiet3 жыл бұрын
most of the interview this question asked ...if not this then ...some what similar to this problem.
@vigneshlakshmipathi26893 жыл бұрын
Thank you so much naveen😍
@khajazakiuddin9313 жыл бұрын
Thank you so much for the amazing videos on Java concepts Naveen. it really helps in improving my coding skills. Could you also please make a video on how to print all the permutations of a given string "abc" (like acb, bca, cab, cba..etc.,). (It was asked in the interview with ADP company). There are many logics present on the internet but not fully understandable, just wanted to get it from you which obviously would be easy to understand and implement.
@Wandereatstravel2 жыл бұрын
Print occurences of each word and character in a string : it was asked in the interview
@fariyabkhan80953 ай бұрын
thank you brother
@parthjadhav25012 жыл бұрын
veryyy very nice explaination
@sayyedfiroz75563 жыл бұрын
Very nice video Naveen
@programminghubbharat75352 жыл бұрын
Yes sir, by just removing the (!) In the if(!string.valueof(c).isBlank()) we got only spaces
@devanandthirunavukkarasu51482 жыл бұрын
sir. thanks for the video .can we do this in java 8
@ashuiet3 жыл бұрын
Thanks!
@aparna50889 ай бұрын
This program is case sensitive the uppercase and lowercase occurences of same letters are counted seperately.
@varshamishra87433 жыл бұрын
Thank you Sir.. Nice video 👍😊
@ananthvraj1832 жыл бұрын
simple remove ! in (String.valueOf(C).isBlank()){} condtion
@lathaa8903 жыл бұрын
Make a video for String Builder and String Buffer bro.
@Gagana_Tgk2 жыл бұрын
String S1="hello" String S2="12345" Output=h1e2l3l4o5. Can you plz write program for above output
@lalitjadaunreaction014 Жыл бұрын
bhai simple hai 1 loop creta karlo then bhs ek character fist string sai or 2nd character from 2 string using charAt[i]. simple sa trika to ye hai . or bhi efficienct way
@mohankumarrewatkar28243 жыл бұрын
Hello Naveen thanks for this video.. One interview que...if u can try for us... String str[]={"Suresh:20","Ramesh:10","Anand:05"} We want to sort the str array on the basis of age....
@mertm22452 жыл бұрын
String str[]={"Suresh:20","Ramesh:10","Anand:05"}; List list= new ArrayList(); for(String s:str){ list.add(Integer.parseInt(s.substring(str[0].indexOf(":")+1))); } Collections.sort(list); String str2[]=new String[str.length]; for(int i=0;i
@VivekKumar-bu6ho Жыл бұрын
Sir, how can i get output as te2s3h if input is teesssh with stream ??
@haribabuvelakavaram59353 жыл бұрын
Hi Naveen, Just a question.. For thr first test case i.e input "test" the output Hashmap values must be {(t,1)(e,1)(s,1)(t,2)} .. right?? Because we are just adding a new key value pair to the hashmap but we are not updating the existing key-value pairs as per this code... For the 4th input character : 't' it will check if 't' is already present in the map. Since it is already there, it will fetch it's value which is 1 and then increments it by 1..so it will become 2 and will update a new key-value pair as( t,2) to the existing hashmap...so the final hashmap output should be {(t,1)(e,1)(s,1)(t,2)} .. Please explain how it is giving {(e,1)(s,1)(t,2)} as output.. Thanks in advance.
@SurajSharma-fw5fg Жыл бұрын
Because he is using HashMap and HashMap can not contain duplicate "key". Hence, only one 't' will be there in HashMap.
@sruthibhagavatula24503 жыл бұрын
Why did you give only hash map? And how to choose which map to use in which scenario?
@anantpandey3092 жыл бұрын
Hi Naveen, I m getting error while using the isBlank() method. Error showing that method isBlank() is undefined for type string.
@vijaykanthperikala3 жыл бұрын
Hi Naveen, I'm getting below error when I try to use "is Blank()" method. "The method isBlank() is undefined for the type String" Could you please help me ? I'm using jdk 1.8.0-301 version
@STUDIES-wv4mw11 ай бұрын
public static void spaceCount(String str) { int count = 0; char[] c = str.toCharArray(); for (char ce : c) { if (ce == ' ') { count++; } } System.out.println("Space Count " + count); }
@utkarshpatil267411 ай бұрын
Answer to the assignment, please do correct otherwise import java.util.HashMap; import java.util.Map; public class charCount { public static void getCharCount(String name) { Map charMap=new HashMap(); char strArray[]=name.toCharArray(); for(char c: strArray) { if(String.valueOf(c).contains(" ")) { if(charMap.containsKey(c)) { charMap.put(c , charMap.get(c)+1 ); } else { charMap.put(c, 1); } } } System.out.println(name + " : " + charMap); } public static void main(String[] args) { // TODO Auto-generated method stub getCharCount("sel sel sel"); } }
@saikumar-io7un2 жыл бұрын
Better, u can do videos for Less time
@ravi542173 жыл бұрын
public class CharCount { public static void main(String[] args) { System.out.println(countBy(" This is a string ", Character::isSpaceChar)); } private static long countBy(final String string, final IntPredicate condition) { return string.chars().filter(condition).count(); } }
@codingsskills.explore2 жыл бұрын
1 2 three 3 4 three 5 6 three 7 8 three.......20.anyone can solve this please aisa output aana chahiye
@district_gamer2 жыл бұрын
sir ap hindi main bnao yr video
@ManishaTech2.O-x4h2 ай бұрын
Class CountCharacters{ public static void getCharCount(String name){ HashMap map=new HashMap(); char[] ch=name.toCharArray(); for(char c: ch){ if(map.containsKey(c)){ map.put(c, map.get(c)+1)} else{ map.put(c,1)} } Sysem.out.println(name:"" +map);} public static void main(String[] args){ getCharCount("TestMock");}}