String Builder | Java Placement Course Lecture 13

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 753

  • @ansariafsar6995
    @ansariafsar6995 11 месяцев назад +49

    finally I'm completed my core java, lots of respect/appreciation to you shraddha mam & your team 👍

  • @saikatghosh6761
    @saikatghosh6761 2 года назад +107

    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 года назад +20

      sb.reverse();
      sout(sb);
      😀

    • @HassanRaza-BSCS-2019
      @HassanRaza-BSCS-2019 2 года назад +21

      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 месяцев назад +3

      bro it's time complexity and space complexity is more than the code givn by mam

    • @navamsharma1888
      @navamsharma1888 5 месяцев назад

      Good.

  • @sumitchoudhary4733
    @sumitchoudhary4733 2 года назад +50

    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 года назад +13

    finally i had completed till now..
    thanks too you maam and sir ❤

  • @harshcarpenter6370
    @harshcarpenter6370 Год назад +49

    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 Год назад +5

      Maybe simplest but not optimized, takes more time and memory.

    • @crackheadweirdo6368
      @crackheadweirdo6368 Год назад +5

      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 Год назад +7

      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 Год назад +2

      You are storing one String to another one, not reversing.

    • @riteshgupta4908
      @riteshgupta4908 Год назад +1

      I also thought of similar logic, but most efficient way is to just create a StringBuilder and use reverse() method

  • @Arshad_mirza007
    @Arshad_mirza007 Месяц назад +1

    Easy Cheezzzyyyy 😊
    StringBuilder rev = new StringBuilder("Hello");
    int i=0; int j=rev.length()-1;
    while(i

  • @naag4852
    @naag4852 3 года назад +171

    We can also use reverse() method in StringBuilder to reverse a string😁

    • @saadmayo8822
      @saadmayo8822 2 года назад +5

      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 года назад +31

      @@saadmayo8822 arey matlab job interviews me without functions karna padta hai bro...They will test your logic building ability

    • @soumyajitghosh9055
      @soumyajitghosh9055 2 года назад +1

      🤣 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 года назад +22

      @@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 Год назад +2

    After watching multiple videos,I finally understood to reverse a string through your video

  • @siddharthsharma5162
    @siddharthsharma5162 3 года назад +25

    Please upload all the lecture ASAP . Waiting for Data Structure and Algorithm part..

  • @siddheshsakpal5798
    @siddheshsakpal5798 2 года назад +25

    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 года назад +39

    Thank you very much 💐❤️ for providing such valuable information . Finally I'm able to learn coding 😀

  • @chandankumarnandan5213
    @chandankumarnandan5213 2 года назад +1

    Ye aisa channel hai jise dekhker mujhe utni hi kushi hoti hai jaise kisi chote bacche ko Doraemon dekhker...🎉🎉😀😀

  • @mohammadajazvlogs5289
    @mohammadajazvlogs5289 3 месяца назад +1

    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 года назад +42

    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 года назад +1

      🎉🎉

    • @vickyboss9687
      @vickyboss9687 2 года назад

      Thanks buddy

    • @shlokgupta4317
      @shlokgupta4317 Год назад +8

      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 Год назад +11

      StringBuilder opposite=new StringBuilder(hello);
      opposite.reverse();
      System.out.println(opposite);
      ye zada asan hai bhai

    • @Balaji-wb7cp
      @Balaji-wb7cp Год назад +1

      🎉🎉🎉🎉🎉

  • @beingaliveshow4922
    @beingaliveshow4922 2 года назад +1

    Aapse to koi begginner wala insaaan kbhi seekh hi nhi skta kuch.

  • @RealJ1659
    @RealJ1659 6 месяцев назад +6

    Apna college's regular students will understand Shraddha didi's obsession with Tony Stark 😅😂😂

  • @naheedaparveen6813
    @naheedaparveen6813 3 года назад +24

    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 года назад +2

      @@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 месяцев назад +2

    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 года назад +9

    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 года назад +1

      Smjha ni
      Isme replace ka to kuch m h

    • @nitinduke
      @nitinduke 2 года назад +1

      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 года назад +1

      @@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 месяца назад +1

      @@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 месяца назад +1

    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 месяцев назад +1

    14:38 Reverse a String : StringBuilder str = new StringBuilder("APNA COLLEGE");
    str.reverse();
    System.out.println(str);
    OUTPUT: EGELLOC ANPA

  • @kunalkheeva
    @kunalkheeva 2 года назад +3

    Took me two days to completely get it, even though it was explained so well. Thank you didi.

  • @anuragsanadhya9359
    @anuragsanadhya9359 2 года назад +1

    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 года назад +19

    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 года назад +7

    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 года назад +1

      @@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 месяцев назад +2

    we can just use sb.reverse(); to reverse the string using StringBuilder.....

  • @pathansohaibhussain8229
    @pathansohaibhussain8229 8 месяцев назад +2

    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 года назад +2

    Best today video about string ❤️

    • @arjun4896
      @arjun4896 3 года назад +1

      Bhai abhi video aaye 2 min bhi nahi hue. Aur tune 24 min ki video dekhke usko best bhi bol diya.

    • @bhavesh099
      @bhavesh099 3 года назад +1

      @@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 года назад +2

    We can also reverse it using two pointer method. Startpoint=0; endPoint =n-1; while loop(start

    • @Ramsharan647
      @Ramsharan647 2 года назад +1

      we wont use pointers in java

  • @mgfun7505
    @mgfun7505 2 года назад +3

    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 Год назад +2

    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 года назад +1

    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 года назад +1

    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);
    }
    }

  • @sushantbhourjar18
    @sushantbhourjar18 8 месяцев назад

    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 года назад +1

    Thanks Didi for best content 🙂

  • @AshishSharma-Dev
    @AshishSharma-Dev 3 года назад +2

    I think, Simplest approach to reverse a string is - use reverse loop (for i = str.length()-1 till 0)

    • @saqlainkazi5770
      @saqlainkazi5770 3 года назад +1

      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

  • @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));
    }
    }
    }

  • @naveenkumarkota2090
    @naveenkumarkota2090 2 года назад

    Keep sharing knowledge shradda

  • @nityasrithumu521
    @nityasrithumu521 2 года назад +16

    please make videos on aptitude and reasoning for campus placements.it will be helpful for palcements in addition to coding.

  • @geetsahu7191
    @geetsahu7191 2 года назад +4

    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 Год назад +1

    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 месяцев назад +1

    Thank you so much mam ❤️👨‍💻✅️

  • @AAKSHAS
    @AAKSHAS 4 месяца назад +1

    4:55 String Builder

  • @gaurisaxena1199
    @gaurisaxena1199 3 года назад +1

    Please complete this course as soon as possible....plzzz...

  • @badalsahoo3902
    @badalsahoo3902 2 года назад +1

    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 12 дней назад

      @@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 месяцев назад +1

    Amazing ❤

  • @suhailahmed2657
    @suhailahmed2657 3 года назад +1

    Finally new video came

  • @ArshdeepSingh-ci3oe
    @ArshdeepSingh-ci3oe 2 года назад +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 месяцев назад +1

    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 месяца назад +1

    Only use reverse(); method for reverse string sb.reverse()

  • @ashitoshbankar4052
    @ashitoshbankar4052 3 года назад +2

    just one suggestion in futre videos for any series please use one editor makes so much confusion between vs and intellij shortcuts

  • @Pegoutamsaini
    @Pegoutamsaini Год назад

    Reverse code can be done like: StringBuilder sb = new StringBuilder("Pegoutam");
    sb.reverse();
    System.out.println(sb);
    }
    }

  • @rishabhmaurya7327
    @rishabhmaurya7327 3 года назад +23

    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);
    }
    }

  • @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 года назад +3

    Amazing😍. Love from Odisha ❤

  • @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 года назад +1

    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 года назад +1

    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 года назад +1

    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 года назад +1

    we can make changes in String without using StringBuilder
    Try this:
    String a ="Elon";
    String name = a.replace("E","M");
    System.out.println(name);

  • @ramaplayz6934
    @ramaplayz6934 Год назад +1

    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

  • @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)..

  • @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--;
    }
    }

  • @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 года назад +1

    12:05
    Meanwhile Marvel : 🤝🫂

  • @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);
    }

  • @RahulTiwari-be1xx
    @RahulTiwari-be1xx 2 года назад

    This logic will only work with the string "hello"

  • @naturelove6425
    @naturelove6425 11 месяцев назад

    15:09 she already gave us a hint about aman bhaiya 😅
    18:31 once again

  • @varunk.16
    @varunk.16 2 года назад +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
    👍👍👍

  • @ishaangarg2001
    @ishaangarg2001 2 месяца назад

    Thankyou soo much didi