Now this code works absolutely fine in one machine but in another just simply refuses to output the correct result.
It is a simple Initials output request. I have no queries with the code but my question is why is it outputting numbers instead of letters?
When running the code from my laptop using Eclipse(Kepler) no issues and I get letters. If i use one of the desktops available to me and the same version of Eclipse I get an integer as a result. It may be settings but I just cant figure out why. And rewriting the code makes no change to the output
import java.util.Scanner;
public class InitialHere {
public static void main(String[] args)
{
// TODO Auto-generated method stub
//Using input keyboard
Scanner kb = new Scanner(System.in);
String firstname,lastname;
//Requesting names
System.out.print("What is your first name?");
firstname = kb.nextLine();
System.out.print("What is your last name?");
lastname = kb.nextLine();
//Calculating the initials
char achar = firstname.charAt(0);
char bchar = lastname.charAt(0);
//Output
System.out.println("Your initials are " + achar + bchar);