Hello,
I'm new to JAVA Programming and I need help. I'm using Eclipse as my IDE and I wrote a program:
package org.babynamecomparison.java;
import java.util.Scanner;
public class BabyNameComparison {
public static void manin(String[] args){
Scanner userInputScanner = new Scanner(System.in);
System.out.print("Enter 1st FirstName");
String name1 = userInputScanner.nextLine();
System.out.print("Enter 2nd First Name");
String name2 = userInputScanner.nextLine();
System.out.print("Enter 3rd First Name");
String name3 = userInputScanner.nextLine();
System.out.println(name1 + "" + name2);
System.out.println(name1 + "" + name3);
System.out.println(name2 + "" + name1);
System.out.println(name2 + "" + name3);
System.out.println(name2 + "" + name1);
System.out.println(name3 + "" + name2);
}
}
When I try to run it, it says "The selection cannot be launched, and there are no recent launches."
I do get a warning that says, "Resource leak: 'userInputScanner' is never closed". What am I doing wrong?