Learn from Leaders, Learn from ABC. Watch our latest technical videos in your language: For Hindi:- bit.ly/2TRuGVP For Kannada:- bit.ly/31NH63M For Telugu:- bit.ly/2MuYRRP For Tamil:- bit.ly/2Num5Hz
@ashishranjan58054 жыл бұрын
class Withoutwhileloop { public static void main(String args[]) { String a="D r a g o n"; char b[]=a.toCharArray(); int count=0; for(char e :b) { Count=count+1 } System.out.print(count); } }
@coolgirlsharu5 жыл бұрын
Thank you sir recently 2 days back I faced these question in technical interview ,to compute the length of the string with out using inbuilt methods....but I was unable to do on that time
@ABCforTechnologyTraining5 жыл бұрын
We are glad that these videos are helping out the student community, Please do subscribe the channel for more updates on the interview questions. x.co/fresher
@balukrishna35815 жыл бұрын
@@ABCforTechnologyTraining can we use charAt rather than sending the data into array
@JahidKhan-tj3nf5 жыл бұрын
Nice teaching techniques
@praanthchinna82665 жыл бұрын
For example without using atleast one inbuilt methods ...... that means concat(),toCharArry() without using these two how count length of string sir.....
@kiranbarhate3944 жыл бұрын
Sir ap bahut accha teach karte ho
@ABCforTechnologyTraining4 жыл бұрын
We are delighted to be of some service to the student community. Happy learning, Kiran!
@ayushkssk4 жыл бұрын
Why use System.out.printf("%d,x.length()); Is it write...?.. I think it's c Syntex. printf or %d
@kolamouni64275 жыл бұрын
Sir, when we use x.concat("/0") Whether null character is placed only in the last... Why can't it be in the middle or starting itself. Since concatenation can be done anywhere
@kiranbarhate3944 жыл бұрын
Sir ap bahut acha reach karte ho
@ABCforTechnologyTraining4 жыл бұрын
We appreciate your response. Thank you, Kiran. Kindly Like, Share and Subscribe. Happy Coding!
@surya_computers5 жыл бұрын
Sir you are using System.out.printf(); printf is allowed in java language.
@ABCforTechnologyTraining5 жыл бұрын
This is precisely the reason for us to have included a DISCLAIMER. printf() method certainly exists even in Java. Watch the video in the link provided and you would get your answer kzbin.info/www/bejne/hIS8koull6lje6s
@praanthchinna82665 жыл бұрын
Sir, "\0" means null .....or what? Suppose concat any special or any other char like "#" now loop traverses like String x =" ABC for JAVA "; X= x.concat("#"); char y [ ] = x . toCharArray( ) ; Int count =0; Int i = 0; while ( y [i] ! = '#' ) { count + +; i + + ; } System. out.print(count) ; }
@birajaprasad4 жыл бұрын
class St{ public static void main(String[]args){ String x="hello"; x=x.concat("4"); char y[]=x.toCharArray(); int i=0; while(y[i]!='4'){ i++; } System.out.println(i); } } U can concat any array ,no need to add '\0' //String str="Hello"; //System.out.println(str.length()); for built in method
@MasterWingman5 жыл бұрын
what is the name of this cool music?
@deeptijha48505 жыл бұрын
hello sir, in previous video u say that how we compute the length of the string by not using inbuilt library function but in this video u will use the inbuilt function that is concat(). why?
@ABCforTechnologyTraining5 жыл бұрын
Your concern is justified. Strings are objects in Java and they do not permit direct access to the individual characters (as in the case of arrays). Please note it is impossible to compute the length of a String in Java without using any in-built method. So, we can re-frame the question the way it will be asked in interview process like this - "Compute the length of a String without using length() in-built method", precisely.
@deeptijha48505 жыл бұрын
@@ABCforTechnologyTraining means in the place of length() we use concat() ?and it is necessary to use inbuilt method only through we compute the length of a string right sir?
@sahithmanchi35274 жыл бұрын
@@deeptijha4850 the use of length() is to show how many characters are present in the given string which is also called as length of the string, but Concat() is used to append the null character for the given string. hope you understand the difference and in the video sir had clearly precised that you will be asked in interviews like without using "length()" inbuilt method.
@HumeiraShaik5 жыл бұрын
Do we include \0 in double quotes in JAVA ???
@ashrafulalan64405 жыл бұрын
thank you sir
@ABCforTechnologyTraining5 жыл бұрын
We all put in a lot of effort; thank you for acknowledging our hard work. Happy learning, ashraful alan!
@sumitkaith35024 жыл бұрын
in java printf is using....? and %d also....?
@deeptijha48505 жыл бұрын
hello sir,why we write here printf instead of println?
@ABCforTechnologyTraining5 жыл бұрын
It is the choice of the programmer to use any of the print facilities provided by a programming language. Also printf() method will permit format specifiers such as %d, %c, %f, etc which is not permitted in the case of println(). Such technical aspirants who come from "C language" background might find it easy to understand the Java code if minimal changes are performed. Nevertheless, you will obtain the same output by using println() as well without format specifiers.
@deeptijha48505 жыл бұрын
@@ABCforTechnologyTraining ok i got it sir thanq sir for clear my doubts.
@LIN30Sec4 жыл бұрын
print() is only for that line println() is change the line
@dhachanamurthydhachanamurt84474 жыл бұрын
😎😎😎😎
@ABCforTechnologyTraining4 жыл бұрын
Happy coding! 😊😊😊
@annapurnatgongadi99885 жыл бұрын
y printf is used in java
@ABCforTechnologyTraining5 жыл бұрын
This is precisely the reason for us to have included a DISCLAIMER. printf() method certainly exists even in Java. Watch the video in the link provided and you would get your answer kzbin.info/www/bejne/hIS8koull6lje6s
@rajatbatra22564 жыл бұрын
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at introduction/strings.StringLength.main(StringLength.java:22) please do resolve this error.
@rajatbatra22564 жыл бұрын
my code- package strings; import java.util.*; import java.util.Arrays; public class StringLength { public static void main(String[] args) { String x = "rajat"; x.concat("\0"); // adding null character; char y[]= x.toCharArray(); // converting to array; int count=0; int i=0; while(y[i]!='\0') { ++count; ++i; } System.out.printf("%d",count); //may also use x.length(); or y.length; } }