answersLogoWhite

0


Best Answer

Take out one letter, using a random number. Then replace the string with the new string, without the extracted letter. Repeat, until the remaining string has a length of zero. The extracted letters get added to a new string.

Take out one letter, using a random number. Then replace the string with the new string, without the extracted letter. Repeat, until the remaining string has a length of zero. The extracted letters get added to a new string.

Take out one letter, using a random number. Then replace the string with the new string, without the extracted letter. Repeat, until the remaining string has a length of zero. The extracted letters get added to a new string.

Take out one letter, using a random number. Then replace the string with the new string, without the extracted letter. Repeat, until the remaining string has a length of zero. The extracted letters get added to a new string.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Take out one letter, using a random number. Then replace the string with the new string, without the extracted letter. Repeat, until the remaining string has a length of zero. The extracted letters get added to a new string.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you scramble a string in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are some example for string formatting in Java?

There are lots of examples of string formatting in Java. It can be difficult at times. Some of these examples are, but are not limited to; align, string, format, and JAVA.


What does it mean to have a string split in java?

To have a string split in Java means that a string array, containing substrings (can be delimited by elements of a specified string or Unicode character array), is returned.


In computer terms what does the phrase 'java string replace' mean?

When referring to computer terms, the phrase "java string replace" means that a string in the line of code that Java uses, is being replaced, or needs to be replaced.


How does the string trim work in Java?

The string trim works in Java by trimming white space from the beginning and end of a string. It cleans up the string and makes makes it neater for the users of the program.


What are the different between'a' and ''a in java string methods?

The difference between 'a' and "a" anywhere in Java is that 'a' is a primitive char type, while "a" is a String object.


Where could someone find an example of Java string comparisons?

There are many sites to find examples of Java string comparisons. Java Revisited, Java Coffee Break, Alvin Alexander, Stack Overflow and Lee Point are a few to start with.


Is String in java a class or object?

In Java, String is a class, but it is also used to create objects. Here's a detailed explanation to clarify this concept: String as a Class The String class is a part of the Java standard library (java.lang.String). It is a final class, which means it cannot be subclassed. The String class provides a wide range of methods for manipulating and working with strings, such as substring(), length(), toUpperCase(), toLowerCase(), charAt(), and many more. String as an Object When you create a string in Java, you are creating an object of the String class. For example, String s = "Hello"; creates a String object with the value "Hello". Even though you can create string literals directly (like "Hello"), these literals are instances of the String class. Key Characteristics of String in Java Immutability: Strings in Java are immutable, meaning once a String object is created, it cannot be changed. Any operation that seems to modify a string actually creates a new String object. String Pool: Java maintains a pool of string literals to optimize memory usage. When you create a string literal, the JVM first checks the string pool. If the literal already exists in the pool, it returns the reference to the existing string. Otherwise, it adds the new literal to the pool. Example: String s1 = "Hello"; String s2 = "Hello"; Here, both s1 and s2 will refer to the same object in the string pool. Creating Strings: You can create strings using string literals or using the new keyword. Example using a literal: String s1 = "Hello"; Example using the new keyword: String s2 = new String("Hello"); Using the new keyword creates a new String object in the heap, bypassing the string pool. In summary: String is a class in Java. You create objects of this class when you use string literals or the new keyword. Strings are immutable, and Java optimizes their storage using a string pool. Understanding these concepts will help you effectively work with strings in Java and utilize their characteristics for better performance and memory management.


What do you mean by string in java programming?

A "string" in any programming language is a line of text.


Concat a string without using any inbuilt function in java?

Use "+". Example: String string = "does this answer " + "your question?";


What is string class features in java?

String class is useful to accept inputs from commands prompt as string arguments


How do you campaire Strings in java?

String class in Java has an 'equals' method that can be used to compare strings.


How many bits does a Java char contain?

16 bits. Java char values (and Java String values) use Unicode.