String Builder | Java Placement Course Lecture 13

  Рет қаралды 903,352

Apna College

Apna College

Күн бұрын

Пікірлер: 754
@ansariafsar6995
@ansariafsar6995 11 ай бұрын
finally I'm completed my core java, lots of respect/appreciation to you shraddha mam & your team 👍
@saikatghosh6761
@saikatghosh6761 2 жыл бұрын
if we have to do the reverse process without using function then we can do it more easily with am empty string and for loop. String s="Saikat"; String rev=""; for(int i=s.length()-1;i>=0;i--){ rev += s.charAt(i); }
@bhat_hazim
@bhat_hazim 2 жыл бұрын
sb.reverse(); sout(sb); 😀
@HassanRaza-BSCS-2019
@HassanRaza-BSCS-2019 2 жыл бұрын
is much more easy..... StringBuilder sb=new StringBuilder ("hello"); sb.reverse(); System.out.println(sb);
@keerthikakudali6520
@keerthikakudali6520 5 ай бұрын
​@@bhat_hazimlol😂
@shivamKumar-ys5rr
@shivamKumar-ys5rr 5 ай бұрын
bro it's time complexity and space complexity is more than the code givn by mam
@navamsharma1888
@navamsharma1888 5 ай бұрын
Good.
@sumitchoudhary4733
@sumitchoudhary4733 2 жыл бұрын
Whatever i will write for Shraddha is always a less. All i can say really appreciate for your effort to put across tough things in simpler way. And explanation in Hindi can be so good that i never thought off. Thanks to everyone who put there effort right from concept wise ,edit wise, teaching wise . You will definitely savior for many of us in terms of basic concepts clearing. kudos to entire team once again.
@deepakrawat2519
@deepakrawat2519 2 жыл бұрын
finally i had completed till now.. thanks too you maam and sir ❤
@harshcarpenter6370
@harshcarpenter6370 Жыл бұрын
For reversing a string simplest way will be: StringBuilder sb = new StringBuilder("Tony"); StringBuilder sb1 = new StringBuilder(""); for(int i = sb.length()-1; i>=0; i--){ sb1.append(sb.charAt(i)); } System.out.println(sb1);
@RahulKumar-oj3cf
@RahulKumar-oj3cf Жыл бұрын
Maybe simplest but not optimized, takes more time and memory.
@crackheadweirdo6368
@crackheadweirdo6368 Жыл бұрын
We can also do it without creating an extra stringbuilder , just by editing on the same stringbuilder ig.... that's more efficient and memory saving
@Roshni_Parashar
@Roshni_Parashar Жыл бұрын
import java.util.*; public class reverseString { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String word= sc.next(); for(int i=word.length()-1;i>=0;i--) { System.out.print(word.charAt(i)); } } } this is also a another way and easy also.
@shubhalagadam7496
@shubhalagadam7496 Жыл бұрын
You are storing one String to another one, not reversing.
@riteshgupta4908
@riteshgupta4908 Жыл бұрын
I also thought of similar logic, but most efficient way is to just create a StringBuilder and use reverse() method
@Arshad_mirza007
@Arshad_mirza007 2 ай бұрын
Easy Cheezzzyyyy 😊 StringBuilder rev = new StringBuilder("Hello"); int i=0; int j=rev.length()-1; while(i
@naag4852
@naag4852 3 жыл бұрын
We can also use reverse() method in StringBuilder to reverse a string😁
@saadmayo8822
@saadmayo8822 2 жыл бұрын
HAHA! Mene bhi reverse () function hi use Kia tha phir me yeh Soch rha tha keh yeh itna bara code kue likh rhi ha..
@swarajhegde9059
@swarajhegde9059 2 жыл бұрын
@@saadmayo8822 arey matlab job interviews me without functions karna padta hai bro...They will test your logic building ability
@soumyajitghosh9055
@soumyajitghosh9055 2 жыл бұрын
🤣 mein bhi use kia reverse()
@soumyajitghosh9055
@soumyajitghosh9055 2 жыл бұрын
@@swarajhegde9059 bro Agar ek 10 min ka kam pe tum pura din leloge toh koi tumhe job nhi dega.
@swarajhegde9059
@swarajhegde9059 2 жыл бұрын
@@soumyajitghosh9055 arey Bhai 😂...me real time interview experience Ka Bola ...interview me Bina function use kiye Karke dikhao Karke puchenge... interviewers check your logic ... Jo bhi function Tu use karega na ..wo function create Karne keliye BHI logic chayiye na 😂...when you develop something from scratch ,you need to build logic for that problem to get solution ... they check how well you can build your problem solutions
@harshsahu3734
@harshsahu3734 Жыл бұрын
After watching multiple videos,I finally understood to reverse a string through your video
@siddharthsharma5162
@siddharthsharma5162 3 жыл бұрын
Please upload all the lecture ASAP . Waiting for Data Structure and Algorithm part..
@siddheshsakpal5798
@siddheshsakpal5798 2 жыл бұрын
1) Reverse String using string builder using inbuilt function. String s2= String.valueOf(s1.reverse()); System.out.println(s2);
@mdakhan7400
@mdakhan7400 Жыл бұрын
She taught us without using any function bro with the help of loops and basic method but yeah a function could be used for time complexity
@AmarKumar-nf3nn
@AmarKumar-nf3nn Жыл бұрын
​​@@mdakhan7400 this one is better then StringBuilder sb = new StringBuilder("Tony Stark"); for(int i=sb.length(); i>=0; i--) { System.out.print(sb.chatAt(i)); }
@Agnos15
@Agnos15 Жыл бұрын
@@AmarKumar-nf3nn sb.length()-1* and sb.charAt(i)*
@shaikasad-yn8he
@shaikasad-yn8he 2 ай бұрын
@@AmarKumar-nf3nn bhai iss loop ko explain karo thoda sa plz for(int i=word.length()-1;i>=0;i--)
@AmarKumar-nf3nn
@AmarKumar-nf3nn 2 ай бұрын
@@shaikasad-yn8he int i = 0; i < sb.length() - 1; i++; Just reverse it, start from last index and go to 1st index like int i = sb.length() - 1; i >= 0; i--;
@005_adityaraghuvanshi6
@005_adityaraghuvanshi6 3 жыл бұрын
Thank you very much 💐❤️ for providing such valuable information . Finally I'm able to learn coding 😀
@RajanGupta-cj4zm
@RajanGupta-cj4zm 3 жыл бұрын
Frm where u studied??
@005_adityaraghuvanshi6
@005_adityaraghuvanshi6 3 жыл бұрын
@@RajanGupta-cj4zm from this channel
@prasenjitnayak_
@prasenjitnayak_ 3 жыл бұрын
kzbin.info/www/bejne/jH-lmaeresumb7c
@chandankumarnandan5213
@chandankumarnandan5213 2 жыл бұрын
Ye aisa channel hai jise dekhker mujhe utni hi kushi hoti hai jaise kisi chote bacche ko Doraemon dekhker...🎉🎉😀😀
@mohammadajazvlogs5289
@mohammadajazvlogs5289 3 ай бұрын
public class Strings{ public static void main(String[]args){ String builder r =new StringBuilder("Apana College"); System.out.println(r.reverse()); } } Output:----- egelloC anpA
@Gamer_0057
@Gamer_0057 2 жыл бұрын
19:48 Didi, we can also reverse a string by - public class sbTest{ public static void main(String[] args) { StringBuilder sb = new StringBuilder("hello"); StringBuilder newSb = new StringBuilder(" "); int j = 0; for(int i = sb.length()-1;i>=0;i--){ newSb.insert(j, sb.charAt(i)); j++; } System.out.print(newSb); }
@naveen-kd2uh
@naveen-kd2uh 2 жыл бұрын
🎉🎉
@vickyboss9687
@vickyboss9687 2 жыл бұрын
Thanks buddy
@shlokgupta4317
@shlokgupta4317 Жыл бұрын
she is showing how to reverse in the same string variable .... if we have to use other variable then there is no need of setbuilder so that's why she presented in that way
@ramaplayz6934
@ramaplayz6934 Жыл бұрын
StringBuilder opposite=new StringBuilder(hello); opposite.reverse(); System.out.println(opposite); ye zada asan hai bhai
@Balaji-wb7cp
@Balaji-wb7cp Жыл бұрын
🎉🎉🎉🎉🎉
@beingaliveshow4922
@beingaliveshow4922 2 жыл бұрын
Aapse to koi begginner wala insaaan kbhi seekh hi nhi skta kuch.
@RealJ1659
@RealJ1659 6 ай бұрын
Apna college's regular students will understand Shraddha didi's obsession with Tony Stark 😅😂😂
@naheedaparveen6813
@naheedaparveen6813 3 жыл бұрын
Didi please upload all the lectures as fast as you can. Thank you!!!
@dewangsingh3376
@dewangsingh3376 3 жыл бұрын
I din m 2 ya 3 kro
@abcbde8283
@abcbde8283 3 жыл бұрын
@@dewangsingh3376 bhai patience rakho video banane me samy aur mehnat aur bhut preparation lagta h aayegi
@dewangsingh3376
@dewangsingh3376 3 жыл бұрын
@@abcbde8283 team work naam ki ek cheez hove hai
@Elif_shk
@Elif_shk 2 жыл бұрын
From were u learn java
@JAY_VEGAD
@JAY_VEGAD 8 ай бұрын
For Reverse the String Easy Way String name = "Tony"; for(int i = name.length() - 1 ; i > = 0 ; i - - ) { System.out.print(name.charAt(i)); }
@SkandGupta-1
@SkandGupta-1 2 жыл бұрын
for reversing the string you can also do this simple method class FirstClass { public static void main(String[] args) { StringBuilder name = new StringBuilder("Hello"); for(int i = name.length()-1;i>=0;i--){ System.out.print(name.charAt(i)); }}}
@ashwinikumar7965
@ashwinikumar7965 2 жыл бұрын
Smjha ni Isme replace ka to kuch m h
@nitinduke
@nitinduke 2 жыл бұрын
it is not actually replacing the string your are just printing theme in reverse order.which it is still same in the code you just show character by character in the reverse order on the console without nextline
@swarajhegde9059
@swarajhegde9059 2 жыл бұрын
@@nitinduke this will help String name="hello"; StringBuilder name2=new StringBuilder(""); int size=name.length()-1; for(int i=size;i>=0;i--){ name2.append(name.charAt(i)); } System.out.println(name2); yeh easy hai but didi ka efficient hai bcoz it has n/2 iterations and this code has n iterations..
@shaikasad-yn8he
@shaikasad-yn8he 2 ай бұрын
@@swarajhegde9059 bhai a length()-1 ka kya matlab hai explain plz
@swarajhegde9059
@swarajhegde9059 2 ай бұрын
@@shaikasad-yn8he basically when someone does length()-1 tho yeh Samaj lena ki length() function jo output dega usse 1 minus ho rha hai. For example name="rahul" Name.length() karne pe rahul name ka length miljayega.. abhi yeh length ko aap apne loop me kaise use karenge wo aap pe depend hai. You can do -1,-2 ,-3 Kitna bhi minus kar sakte ho .use it according to your needs
@aryanjsangwai2582
@aryanjsangwai2582 2 ай бұрын
Instead of front and back character we can simply do reverse for loop and return the reverse string using charAt public class reverstring { public static void main(String[] args) { StringBuilder sb=new StringBuilder("nayra"); System.out.println(sb); int n=sb.length(); for(int i=n-1;i>=0;i--){ System.out.print(sb.charAt(i)); it will display "aryan"
@Fayroll5
@Fayroll5 Ай бұрын
StringBuilder sb = new StringBuilder("nayra"); sb.reverse(); System.out.println(sb);
@AIYouTubeTricks
@AIYouTubeTricks 11 ай бұрын
14:38 Reverse a String : StringBuilder str = new StringBuilder("APNA COLLEGE"); str.reverse(); System.out.println(str); OUTPUT: EGELLOC ANPA
@AIYouTubeTricks
@AIYouTubeTricks 11 ай бұрын
Very easy 👍🏻
@kunalkheeva
@kunalkheeva 2 жыл бұрын
Took me two days to completely get it, even though it was explained so well. Thank you didi.
@csea_37_shayoribhowmick53
@csea_37_shayoribhowmick53 2 жыл бұрын
Same here
@csea_37_shayoribhowmick53
@csea_37_shayoribhowmick53 2 жыл бұрын
Thought I was the only person learning late
@anuragsanadhya9359
@anuragsanadhya9359 2 жыл бұрын
Hates off to @Apna_college . Really need this kind of contant . Thanks a lot.
@himanshukumarsingh1384
@himanshukumarsingh1384 2 жыл бұрын
you are carrer saver giving free valuable content god bless you
@shortslux9668
@shortslux9668 2 жыл бұрын
real fan of tony stark🤣😂
@prathmeshsingh9699
@prathmeshsingh9699 2 жыл бұрын
Madam your way of explaining is awesome
@sapnanaz-m4l
@sapnanaz-m4l 9 ай бұрын
Thankyou so much mam for teaching coding with simple way
@honeyhemanth401
@honeyhemanth401 2 жыл бұрын
thank you APNA COLLEGE. you guys are great.
@shaikhasifmahebub9460
@shaikhasifmahebub9460 3 жыл бұрын
Thanks didi but pura course complete kigiye hume apke video se bahot help hoti hai
@yujityadav3049
@yujityadav3049 2 жыл бұрын
At 17:00 we can also do by using for loop is just reverse direction like initialising by { name.lengthI()-1 to 0 } considering name as out String and just print 🙃🙃🙃🙃
@earthlover449
@earthlover449 2 жыл бұрын
By using loop we can just print a string in reverse ,but can't reverse
@swarajhegde9059
@swarajhegde9059 2 жыл бұрын
@@earthlover449 i think this is what he meant --------> String name="hello"; StringBuilder name2=new StringBuilder(""); int size=name.length()-1; for(int i=size;i>=0;i--){ name2.append(name.charAt(i)); } System.out.println(name2); but jo didi ne sikhaya usme kam iterations use hote hai (n/2)...isme n iterations use hote hai...difference is vast when input is big..aisa lagta hai
@empire9044
@empire9044 2 жыл бұрын
@@swarajhegde9059 bhai isme string reverse nehi hua, given string ki value dusri string mein reverse order mein store hua.. given string ka order same hi reh gaya
@nagendrak4826
@nagendrak4826 8 ай бұрын
we can just use sb.reverse(); to reverse the string using StringBuilder.....
@pathansohaibhussain8229
@pathansohaibhussain8229 8 ай бұрын
SImple code to reverse the String StringBuilder a = new StringBuilder("aman"); for (int i=a.length()-1;i>=0;i--) { System.out.print(a.charAt(i)); }
@fitnessmasterzain5654
@fitnessmasterzain5654 3 жыл бұрын
Best today video about string ❤️
@arjun4896
@arjun4896 3 жыл бұрын
Bhai abhi video aaye 2 min bhi nahi hue. Aur tune 24 min ki video dekhke usko best bhi bol diya.
@bhavesh099
@bhavesh099 3 жыл бұрын
@@arjun4896 true 😂😂😂 Ye bss promotion k liye h 😂
@fitnessmasterzain5654
@fitnessmasterzain5654 3 жыл бұрын
@@arjun4896 talent bro😂
@tarangsingh9110
@tarangsingh9110 Жыл бұрын
Reverse for loop se bhi. Ho jayega for (int i=(sb.length()-1);i>=0;i--){ System.out.print(sb.charAt(i));
@masteradvisor594
@masteradvisor594 Жыл бұрын
function to reverse static StringBuilder reverse( StringBuilder str){ int n = str.length()-1; for( int i=0; i
@nitesh827
@nitesh827 2 жыл бұрын
We can also reverse it using two pointer method. Startpoint=0; endPoint =n-1; while loop(start
@Ramsharan647
@Ramsharan647 2 жыл бұрын
we wont use pointers in java
@mgfun7505
@mgfun7505 2 жыл бұрын
Easy way to reverse the string. for(int i= str.length()-1;i>=0;i--) { System.out.print(str.charAt(i));
@pramodpandey6457
@pramodpandey6457 2 жыл бұрын
It is just printing , in video mam has done how to actually reverse the main string ... in your loop as soon as the loop ends ... string gets back to its original value
@moviesmax398
@moviesmax398 Жыл бұрын
System.out.println("Java is little harder some tricks please");
@rsuryavlogs4984
@rsuryavlogs4984 Жыл бұрын
Reverse string String s ="Hello"; String rev =""; for(int i=0; i
@rsuryavlogs4984
@rsuryavlogs4984 Жыл бұрын
StringBuilder sb = new StringBuilder("hello"); System.out.println(sb.reverse());
@mgkigyanibaate7236
@mgkigyanibaate7236 2 жыл бұрын
bohot pyaara explaination
@aagam69
@aagam69 Жыл бұрын
best way to reverse a string is String reversal= sb.reverse().toString(); System.out.println(reversal);
@Rieshu-s1m
@Rieshu-s1m 10 ай бұрын
#Apna College & shradda didi rocks
@tapanmahata8330
@tapanmahata8330 2 жыл бұрын
Very good explanation
@BhardwajHackology
@BhardwajHackology 2 жыл бұрын
SIMPLE WAY TO REVERSE STRING : String name = "Himanshu"; int m = name.length(); String reverse = ""; for (int i = m - 1; i >= 0; i--) { reverse += name.charAt(i); } System.out.println(reverse);
@subhamsahani2948
@subhamsahani2948 2 жыл бұрын
we can also write in these form:- import java.util.*; public class Main{ public static void main (String[] args) { String b = ""; Scanner s = new Scanner(System.in); String a = s.next(); for(int i=a.length();i>0;i--){ b+=a.charAt(i-1); } System.out.println(b); } }
@mayankjain5682
@mayankjain5682 2 жыл бұрын
using extra space is not a recommended solution
@mrutyunjayapradhan3599
@mrutyunjayapradhan3599 Жыл бұрын
Well try bro ❤ but It will take extra space and time 🙂
@sushantbhourjar18
@sushantbhourjar18 9 ай бұрын
For reversing all characters of a string can also be done by import java.util.Scanner; public class javaArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); StringBuilder sb = new StringBuilder(str); int len = sb.length(); for(int i=len-1;i>=0;i--) { System.out.print(sb.charAt(i)+" "); } } }
@PankajGupta-qb2bt
@PankajGupta-qb2bt 2 жыл бұрын
Thanks Didi for best content 🙂
@AshishSharma-Dev
@AshishSharma-Dev 3 жыл бұрын
I think, Simplest approach to reverse a string is - use reverse loop (for i = str.length()-1 till 0)
@saqlainkazi5770
@saqlainkazi5770 3 жыл бұрын
that will just print the string in reverse order but the string remains the same
@rajeswariputatunda5093
@rajeswariputatunda5093 2 жыл бұрын
@@saqlainkazi5770 yess but you can add the elements of reverse string loop in a different string using charAt function
@naveenkumarkota2090
@naveenkumarkota2090 2 жыл бұрын
Keep sharing knowledge shradda
@vortex4900
@vortex4900 Жыл бұрын
reversing the string can be done very simply with a basic logic public class str4 { public static void main(String[] args) { String str = "hello"; int length = str.length(); for(int i = length-1;i>=0;i--){ System.out.print(str.charAt(i)); } } }
@nityasrithumu521
@nityasrithumu521 2 жыл бұрын
please make videos on aptitude and reasoning for campus placements.it will be helpful for palcements in addition to coding.
@venkat6654
@venkat6654 2 жыл бұрын
yes
@geetsahu7191
@geetsahu7191 2 жыл бұрын
I think this will be more easiest way to reverse a String.... public static void main(String[] args) { String a = "Geet"; for(int i = a.length() - 1 ; i >= 0 ; i --){ System.out.print(a.charAt(i)); } }
@gumball-lazy
@gumball-lazy 2 жыл бұрын
buffer reader ko use karke String rev=anystring,Reverse(); use kar sakte ho
@C19-Edits12
@C19-Edits12 6 ай бұрын
💯🥀 exactly
@Nakshatra_02
@Nakshatra_02 2 ай бұрын
Why did u did? a. Length() -1
@kuldeepyadav9349
@kuldeepyadav9349 Жыл бұрын
didi aap bohot acche se samjati ho but video thoda lamba kr deti thoda short jo ske tou jaroor krna .thanks
@DHEERAJ_R
@DHEERAJ_R 6 ай бұрын
Thank you so much mam ❤️👨‍💻✅️
@AAKSHAS
@AAKSHAS 4 ай бұрын
4:55 String Builder
@gaurisaxena1199
@gaurisaxena1199 3 жыл бұрын
Please complete this course as soon as possible....plzzz...
@badalsahoo3902
@badalsahoo3902 2 жыл бұрын
8:28 you can also use a simple method replace instead of setting the char .
@anikaitdash6519
@anikaitdash6519 2 ай бұрын
I am currently doing a marathon of Java & DSA Course playlist.
@Aimbolino572
@Aimbolino572 2 ай бұрын
How're you learning DSA in java?
@anikaitdash6519
@anikaitdash6519 13 күн бұрын
@@Aimbolino572 From this channel and other channels.
@subhojitsarkar3835
@subhojitsarkar3835 Жыл бұрын
StringBuilder sb = new StringBuilder("Hello"); sb.reverse(); // becomes "olleH" // simplest answer O(1)
@Ankit-lv5mu
@Ankit-lv5mu 2 жыл бұрын
u r great Microsoft Didi ❤❤
@Loveralwayscrazy
@Loveralwayscrazy 10 ай бұрын
Amazing ❤
@suhailahmed2657
@suhailahmed2657 3 жыл бұрын
Finally new video came
@ArshdeepSingh-ci3oe
@ArshdeepSingh-ci3oe 2 жыл бұрын
I do this question in my style import java.util.*; public class learning{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); String name = "Hello"; int i = name.length(); while(i > 0){ i = i -1; System.out.print(name.charAt(i)); } } }
@dyvikmanju6255
@dyvikmanju6255 7 ай бұрын
i used this logic 🙄 StringBuilder st=new StringBuilder("helllllo"); for (int i=st.length()-1;i>=0;i--) { System.out.println(st.charAt(i)); } ik its gonna print line by line... but logic seems comfortable
@Experiencedthroughlife
@Experiencedthroughlife 6 ай бұрын
Don't use println instead use print which print it in a single line
@shatayuakare4493
@shatayuakare4493 2 жыл бұрын
For reverce String this short cut method public static String ReverceString(String str){ for (int i=str.length()-1; i>=0; i--){ System.out.print(str.charAt(i)); } return str; }
@KishorDhobale-q8e
@KishorDhobale-q8e 4 ай бұрын
Only use reverse(); method for reverse string sb.reverse()
@Pegoutamsaini
@Pegoutamsaini Жыл бұрын
Reverse code can be done like: StringBuilder sb = new StringBuilder("Pegoutam"); sb.reverse(); System.out.println(sb); } }
@ashitoshbankar4052
@ashitoshbankar4052 3 жыл бұрын
just one suggestion in futre videos for any series please use one editor makes so much confusion between vs and intellij shortcuts
@rishabhmaurya7327
@rishabhmaurya7327 3 жыл бұрын
We can reverse String without StringBuilder. But we have to make a new String. import java.util.*; public class ReverseString { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String newStr = ""; for(int i=str.length()-1; i>=0; i--){ newStr += str.charAt(i); } System.out.println(newStr); } }
@riponislam6164
@riponislam6164 Жыл бұрын
Sahi hain
@shaikasad-yn8he
@shaikasad-yn8he 2 ай бұрын
bhai a length()-1 ka kya matlab hai explain plz
@HEXABONG
@HEXABONG 2 жыл бұрын
Also reverse a string by this way: String palindrome = "Hello World" , reverseStr = ""; int strLength = palindrome.length(); for(int i = strLength-1; i>=0; i--){ reverseStr = reverseStr + palindrome.charAt(i); } System.out.println(reverseStr);
@barsharanipati6575
@barsharanipati6575 3 жыл бұрын
Amazing😍. Love from Odisha ❤
@apurvakoduganti2041
@apurvakoduganti2041 3 жыл бұрын
Same !
@soumyaranjangumansingh9080
@soumyaranjangumansingh9080 3 жыл бұрын
Same...but JEE dropper
@rameshmalhotra9525
@rameshmalhotra9525 3 жыл бұрын
kzbin.info/www/bejne/l6jLp4N6lMiXiNk
@kuldeepsahoo4680
@kuldeepsahoo4680 Жыл бұрын
Wow same but in 2023
@imransindhi7318
@imransindhi7318 Жыл бұрын
Aslam o Alikum i am from pakistan apke video se main boht kujh sekh rah ho i love sis agr main sucesses hogya to apse milne zoror aoga, I love sis Allah Apko Khush rakhi or Aman Bhai ko😍🥰
@technikalproblem6780
@technikalproblem6780 Жыл бұрын
Thanks a lot for creating this video!
@Aspirant65.
@Aspirant65. 2 ай бұрын
Happy teachers day shradhha di😊❤
@harshthakur9890
@harshthakur9890 3 жыл бұрын
Thank you so much for providing best content.
@11ajayalaxmimudaliar27
@11ajayalaxmimudaliar27 5 ай бұрын
public static void main(String args[]) { StringBuilder str = new StringBuilder("hello"); for (int i = (str.length() - 1); i >= 0; i--) { System.out.print(str.charAt(i)); } str.reverse(); System.out.print(str); } more easy and simple code in single line
@autodocofficial2161
@autodocofficial2161 3 жыл бұрын
Really thnks alot dii...Really means a lot ...wait for last 2 days ki kab aayagi apki video 😁....but np aap ka kaam bhi simple nhii hai..to explain in such a simplified way...🤗
@nazeershaik9812
@nazeershaik9812 2 жыл бұрын
REVERSE STRING USING STRING BUILDER :: public class reverseStringBuilder { public static void main(String[] args) { StringBuilder sb = new StringBuilder("Hell"); for (int i = 0; i
@youtubers_united
@youtubers_united 2 жыл бұрын
Didi I used a for loop for whole length for reversing and the method which you gave. the time complexity did not reduce by half. first one was 3s 454 ms and second one was 3s 745 ms
@brainworkout3799
@brainworkout3799 Жыл бұрын
loop alone will not determine time complexity, many common things such as creation of string and initialization of variables were common
@ShaikShaikshavali-e9y
@ShaikShaikshavali-e9y Жыл бұрын
Use reverse() of StringBuilder's method for reverse a String
@Amanxtcode
@Amanxtcode Жыл бұрын
uh... bechara Tony badal ke Pony ho gaya😁
@dibyanshusingh2423
@dibyanshusingh2423 11 ай бұрын
18:30 agar humare pass yahan Aman hota ❤❤😂😂
@kalyanansuri
@kalyanansuri Жыл бұрын
To reverse string : For loop lenght-1 se lekar 0 tak chalake, charAT(i) ko print karliya tho hojayega
@Shawonmondal
@Shawonmondal Жыл бұрын
Reverse String import java.util.Scanner; public class flip { public static void main(String[] args) { String b = "Aman"; for(int i=0; i
@divyanshsharma8540
@divyanshsharma8540 5 ай бұрын
Scanner sc = new Scanner(System.in); String a= sc.nextLine(); String k = " "; for(int i =0;i
@darshanpagar1894
@darshanpagar1894 2 жыл бұрын
In c++ for(int i = 0; i < s.size()/2; i++) { swap(s[i],s[s.size() - 1 - i]); }
@manojverma245
@manojverma245 2 жыл бұрын
public class Main { public static void main(String[] args) { String name = "Manoj"; String rev = " "; for(int i=name.length()-1;i>=0;i--){ rev = rev+name.charAt(i); } System.out.println(rev); } }
@dikshantakumarbharadwaj6052
@dikshantakumarbharadwaj6052 2 жыл бұрын
we can make changes in String without using StringBuilder Try this: String a ="Elon"; String name = a.replace("E","M"); System.out.println(name);
@sadabalam8316
@sadabalam8316 2 жыл бұрын
Mlon
@ramaplayz6934
@ramaplayz6934 Жыл бұрын
StringBuilder opposite=new StringBuilder(hello); opposite.reverse(); System.out.println(opposite); mam ye bhi to thik hai
@Anonymous-ue1wp
@Anonymous-ue1wp 3 жыл бұрын
jaldi jaldi dalo can't wait
@ompatel7410
@ompatel7410 Жыл бұрын
public void reverseString(char[] s) { int start = 0; int end = s.length - 1; while(start < end){ char tmp = s[start]; s[start] = s[end]; s[end] = tmp; start++; end--; } }
@VinayakSharma0077
@VinayakSharma0077 6 ай бұрын
8:50 to anyone facing error during this code which looks like this: java: incompatible types: java.lang.String cannot be converted to char then just change the character to 'P' from "P" in the setCharAt function.. I am also new to java and i think apparently java considers " " to be Strings and ' ' to be Character (Char)..
@sehajbrar9815
@sehajbrar9815 2 жыл бұрын
you are brilliant tnk u so much
@tobateksingh4933
@tobateksingh4933 3 жыл бұрын
Great Upload video of python programming language.
@MrDoggo-nd1jv
@MrDoggo-nd1jv 2 жыл бұрын
12:05 Meanwhile Marvel : 🤝🫂
@RahulTiwari-be1xx
@RahulTiwari-be1xx 2 жыл бұрын
This logic will only work with the string "hello"
@mohitdodiya3989
@mohitdodiya3989 Жыл бұрын
we can use this code for revers String .. public static void main(String[] args) { StringBuilder sb = new StringBuilder("MOhitDodiya"); StringBuilder sb2 = new StringBuilder(""); for(int i=sb.length()-1;i>=0;i--){ sb2.append(sb.charAt(i)); } System.out.println(sb2); }
@naturelove6425
@naturelove6425 11 ай бұрын
15:09 she already gave us a hint about aman bhaiya 😅 18:31 once again
@varunk.16
@varunk.16 2 жыл бұрын
Are hum ya pe reverse for loop bhi to use kr skte hai..... String name = "Varun"; for(int i = name.length()-1; i>=0; i--){ System.out.print( name.charAt( i ) ) ; } //Output == nuraV 👍👍👍
@athardoi9161
@athardoi9161 2 жыл бұрын
This also one of Solution to make String reverse & time complexity will remain same O(n) String name = "athar"; String result = ""; for(int i=name.length()-1; i>=0; i--){ result = result + name.charAt(i); }
@Babu-lt4vt
@Babu-lt4vt 2 жыл бұрын
StringBuilder sb= new StringBuilder("hello"); for (int i=sb.length()-1;i>=0;i--) { System.out.print(sb.charAt(i)); } }
@Babu-lt4vt
@Babu-lt4vt 2 жыл бұрын
I think this will be also correct
Operators & Binary Number System | Java Lecture 14
36:18
Apna College
Рет қаралды 749 М.
Strings | Lecture 12 | Java Placement Series
26:07
Apna College
Рет қаралды 1,2 МЛН
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 2,9 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 99 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 17 МЛН
#36 StringBuffer and StringBuilder in Java
5:41
Telusko
Рет қаралды 218 М.
How I would learn to code (If I could start over)
13:14
CodeWithHarry
Рет қаралды 165 М.
Kyiv proposes terms to Moscow / Conditions for negotiations
15:01
Arrays Introduction | Java Complete Placement Course | Lecture 10
25:44
Apna College
Рет қаралды 1,8 МЛН
you will never ask about pointers again after watching this video
8:03
Strings and StringBuilder in Java
1:27:29
Kunal Kushwaha
Рет қаралды 504 М.
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 2,9 МЛН