You need to replace the charAt method with the substring method:
String vacantion = "Vacantion";
int number = 1;
for (int i = 0; i < vacantion.length(); i++)
{
System.out.println(vacantion.substring(vacantion.length() - number));
number++;
}
More Related Contents:
- Recommendations for a heap analysis tool for Java? [closed]
- Dynamic JComboBoxes
- How to load a jar file at runtime [duplicate]
- Maximum length of Intent putExtra method? (Force close)
- How to open the default webbrowser using java
- Difference between @Mock, @MockBean and Mockito.mock()
- How does the JVM decided to JIT-compile a method (categorize a method as “hot”)?
- What is the purpose of @NamedArg annotation in javaFX 8?
- Can the JVM recover from an OutOfMemoryError without a restart
- How do I call some blocking method with a timeout in Java?
- How to get a value from the last inserted row? [duplicate]
- How can I calculate the difference between two ArrayLists?
- How to unit test abstract classes: extend with stubs?
- InetAddress.getLocalHost() slow to run (30+ seconds)
- Create list of object from another using Java 8 Streams
- JPA how to make composite Foreign Key part of composite Primary Key
- How to check if an element is visible with WebDriver
- Postfix and OpenJDK 11: “No appropriate protocol (protocol is disabled or cipher suites are inappropriate)”
- Splitting String and put it on int array
- Flattening a collection
- How can I find out which button was clicked?
- How to test if one java class extends another at runtime?
- Using an empty column as a divider in a JTable
- SwingWorker does not update JProgressBar without Thread.sleep() in custom dialog panel
- Cross-platform way to change java process priority
- Why does Java think that the product of all numbers from 10 to 99 is 0?
- Unable to connect to database (No suitable driver found)
- JavaFX 2.2 TextField maxlength
- Stopping a specific java thread
- How to check a boolean condition in EL?