Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Picking middle string in lexicographic ordering

$
0
0
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.

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();
		
	}
	
	

}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>