Answers for ".reverse java"

1

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;
        }
    }
Posted by: Guest on November-01-2021
3

reverse string java

String string="whatever";
String reverse = new StringBuffer(string).reverse().toString();
System.out.println(reverse);
Posted by: Guest on October-14-2020
1

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}
Posted by: Guest on April-18-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language