Computing length of String in Java | Java Programs | Strings in Java | ABC

  Рет қаралды 56,654

ABC - Technology Training & Upskilling

ABC - Technology Training & Upskilling

Күн бұрын

Пікірлер: 36
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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
@ashishranjan5805
@ashishranjan5805 4 жыл бұрын
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); } }
@coolgirlsharu
@coolgirlsharu 5 жыл бұрын
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
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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
@balukrishna3581
@balukrishna3581 5 жыл бұрын
@@ABCforTechnologyTraining can we use charAt rather than sending the data into array
@JahidKhan-tj3nf
@JahidKhan-tj3nf 5 жыл бұрын
Nice teaching techniques
@praanthchinna8266
@praanthchinna8266 5 жыл бұрын
For example without using atleast one inbuilt methods ...... that means concat(),toCharArry() without using these two how count length of string sir.....
@kiranbarhate394
@kiranbarhate394 4 жыл бұрын
Sir ap bahut accha teach karte ho
@ABCforTechnologyTraining
@ABCforTechnologyTraining 4 жыл бұрын
We are delighted to be of some service to the student community. Happy learning, Kiran!
@ayushkssk
@ayushkssk 4 жыл бұрын
Why use System.out.printf("%d,x.length()); Is it write...?.. I think it's c Syntex. printf or %d
@kolamouni6427
@kolamouni6427 5 жыл бұрын
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
@kiranbarhate394
@kiranbarhate394 4 жыл бұрын
Sir ap bahut acha reach karte ho
@ABCforTechnologyTraining
@ABCforTechnologyTraining 4 жыл бұрын
We appreciate your response. Thank you, Kiran. Kindly Like, Share and Subscribe. Happy Coding!
@surya_computers
@surya_computers 5 жыл бұрын
Sir you are using System.out.printf(); printf is allowed in java language.
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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
@praanthchinna8266
@praanthchinna8266 5 жыл бұрын
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) ; }
@birajaprasad
@birajaprasad 4 жыл бұрын
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
@MasterWingman
@MasterWingman 5 жыл бұрын
what is the name of this cool music?
@deeptijha4850
@deeptijha4850 5 жыл бұрын
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?
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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.
@deeptijha4850
@deeptijha4850 5 жыл бұрын
@@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?
@sahithmanchi3527
@sahithmanchi3527 4 жыл бұрын
@@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.
@HumeiraShaik
@HumeiraShaik 5 жыл бұрын
Do we include \0 in double quotes in JAVA ???
@ashrafulalan6440
@ashrafulalan6440 5 жыл бұрын
thank you sir
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
We all put in a lot of effort; thank you for acknowledging our hard work. Happy learning, ashraful alan!
@sumitkaith3502
@sumitkaith3502 4 жыл бұрын
in java printf is using....? and %d also....?
@deeptijha4850
@deeptijha4850 5 жыл бұрын
hello sir,why we write here printf instead of println?
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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.
@deeptijha4850
@deeptijha4850 5 жыл бұрын
@@ABCforTechnologyTraining ok i got it sir thanq sir for clear my doubts.
@LIN30Sec
@LIN30Sec 4 жыл бұрын
print() is only for that line println() is change the line
@dhachanamurthydhachanamurt8447
@dhachanamurthydhachanamurt8447 4 жыл бұрын
😎😎😎😎
@ABCforTechnologyTraining
@ABCforTechnologyTraining 4 жыл бұрын
Happy coding! 😊😊😊
@annapurnatgongadi9988
@annapurnatgongadi9988 5 жыл бұрын
y printf is used in java
@ABCforTechnologyTraining
@ABCforTechnologyTraining 5 жыл бұрын
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
@rajatbatra2256
@rajatbatra2256 4 жыл бұрын
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.
@rajatbatra2256
@rajatbatra2256 4 жыл бұрын
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; } }
Copying one String into another in Java | Java programming | Strings in Java | ABC
5:42
ABC - Technology Training & Upskilling
Рет қаралды 54 М.
How to convert lowercase Strings to uppercase in Java | Strings Programming  tutorials | Part 1
9:28
ABC - Technology Training & Upskilling
Рет қаралды 43 М.
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,6 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 33 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 14 МЛН
Pangram Program in Java | Pangram Problem Solution | Interview Questions on Pangram | ABC
16:53
ABC - Technology Training & Upskilling
Рет қаралды 56 М.
Introduction to MAP Data Structure in Java | HashMap in Java with Example | ABC
12:40
ABC - Technology Training & Upskilling
Рет қаралды 44 М.
Loops in Java | for | while | do-while | for-each loop in java | loops in java programming | ABC
13:56
ABC - Technology Training & Upskilling
Рет қаралды 24 М.
How to verify if a String contains only integers | Java Tutorials | String Program in Java
10:25
ABC - Technology Training & Upskilling
Рет қаралды 35 М.
An Honest Review of Apple Intelligence... So Far
17:49
Marques Brownlee
Рет қаралды 2,5 МЛН
STRING CLASS & STRING METHODS - JAVA PROGRAMMING
33:17
Sundeep Saradhi Kanthety
Рет қаралды 202 М.
How to: Work at Google - Example Coding/Engineering Interview
24:02
Life at Google
Рет қаралды 7 МЛН
Computer Science Is Not Software Engineering
14:55
Aman Manazir
Рет қаралды 136 М.
How I Failed the Google Coding Interview (and lessons I learned)
14:24
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,6 МЛН