I don't understand why it just prints numbers.
/* This program converts the first letters of the entered strings for an array to uppercase*/
import java.util.*;
import java.lang.String.*;
public class myfirstarray{
static Scanner scan = new Scanner(System.in);
static String str1, str2,str3, str4,str5;
public static void main (String[]args){
String[] items = new String[5];
int counter;
System.out.println("Enter 5 strings");
for (counter = 0; counter < items.length ; counter++ )
{ items[counter] = scan.nextLine();
str1 = items[counter];
str2 = items[counter];
str3 = items[counter];
str4 = items[counter];
str5 = items[counter];}
char firstletter1 = str1.charAt(0);
char firstletter2 = str2.charAt(0);
char firstletter3 = str3.charAt(0);
char firstletter4 = str4.charAt(0);
char firstletter5 = str5.charAt(0);
System.out.println(firstletter1 + firstletter2 + firstletter3 + firstletter4 + firstletter5);
}
}
****
**SAMPLE RUN FROM COMMAND PROMPT:
Enter 5 strings
i
have
no
idea
why
595
Press any key to continue . . .
******
**
it's supposed to output
i h n i w**