Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

string reverse in java

String str = "Hello";
String reverse(String str){
  StringBuilder sb = new StringBuilder();
  sb.append(str);
  sb.reverse();
  return sb.toString();
}
Comment

reverse in jaav

// my linkedin : https://www.linkedin.com/in/vaalarivan-prasanna-3a07bb203/
list = new ArrayList<int> {3, 4, 7};  //initialising a list
Collections.reverse(list);  //reverses a List or an ArrayList
//now, list is {7, 4, 3}
Comment

reverse java

public void reverse()
    {
        for (int i = 0; i < size/2; i++)
        {
            int temp = get(i);
            elementData[i] = elementData[size-i-1];
            elementData[size-i-1] = temp;
        }
    }
Comment

String reverse in java

1)
String str = "Hello";
String result = "";

  for(int i = str.length()-1; i>=0; i--){
     result += str.charAt(i); // first solution, charAt method
 //  result += str1.substring(i, i+1); // first solution,  substring method
   }
   System.out.println(result);
}

Comment

array reverse in java

        int[] xr = {1, 2, 3, 4, 5};

        System.out.print("[");
        for (int i = xr.length - 1; i >= 0; i--) {
            System.out.print(xr[i] + ", ");
        }
        System.out.println("]");
    }
Comment

String reverse in Java

StringBuilder sb1 = new StringBuilder("Mahmut");
        sb1.reverse();
        System.out.println(sb1); // tumhaM
Comment

PREVIOUS NEXT
Code Example
Java :: create a hashmap 
Java :: fibonacci series in java 
Java :: implement stack using linked list java 
Java :: node in java 
Java :: even and odd java & 
Java :: how to check if a person presses a button in jframe in java 
Java :: java newinstance alternative 
Java :: java array sorting java8 
Java :: Loop in singly linked list 
Java :: get executable path java 
Java :: sort 2d array based on one column java 
Java :: convert date to localdate java 
Java :: If you are using the git profile, you need to set a Git URI in your configuration. If you have set spring.cloud.config.server.bootstrap=true, you need to use a composite configuration. 
Java :: Java The Throw/Throws Keyword 
Java :: java print method 
Java :: do while jaca 
Java :: pass array to method java 
Java :: java implement interface 
Java :: Simple While Loop Java Example 
Java :: better way to check string on null and empty java 
Java :: Java Access PriorityQueue Elements 
Java :: merging two sorted arrays 
Java :: java generics 
Java :: overload and override in java 
Java :: object creation in java 
Java :: java class in dataweave 
Java :: java stream code to ignore null 
Java :: enhance for loop java 
Java :: android select video samsung stackoverflow 
Java :: how to recognize a pressed key in java 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =