Hi,
Recently I've been learning Java in my spare time, and in doing so, testing myself with questions.
I've come across one that i can't get a handle on.
I'm asking the user for three string inputs, then printing the middle string after lexicographical ordering.
I just can't get to grips with it.
Any suggestions?
Thank you.
Recently I've been learning Java in my spare time, and in doing so, testing myself with questions.
I've come across one that i can't get a handle on.
I'm asking the user for three string inputs, then printing the middle string after lexicographical ordering.
I just can't get to grips with it.
Any suggestions?
Thank you.
import java.util.Scanner; public class q_3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter a word: "); String first = scan.next(); System.out.print("Enter a second word: "); String second = scan.next(); System.out.print("Enter a third word: "); String third = scan.next(); } }