MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/SwitchingLetters.java:5–18  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

3public class SwitchingLetters {
4
5 public static void main(String[] args) {
6
7 Scanner keyboard = new Scanner(System.in);
8
9 System.out.println("Please enter two numbers:");
10 int index1 = keyboard.nextInt() - 1;
11 int index2 = keyboard.nextInt() - 1;
12
13 keyboard.nextLine();
14 System.out.println("Please enter a sentence:");
15 String sentence = keyboard.nextLine();
16
17 System.out.println("The new sentence:\n" + switchLetters(index1, index2, sentence));
18 }
19
20 /* Switches letters according to given indexes. */
21

Callers

nothing calls this directly

Calls 1

switchLettersMethod · 0.95

Tested by

no test coverage detected