11 Replies Latest reply: Sep 27, 2006 12:10 PM by 807598 RSS

    I need Help to print characters as one word

    807598
      Hi I would like to know how can I print characters as one word?
      This is my code but as you can see it doesn't print as one word. Thanks.
      public static void main(String[]args)
            { 
            //declaration section
               String test = ("This is a Test Input for Assignment Number 5.");
               
            //charAt method will extract the characters 0,11,26,and 34
               char char1, char2, char3,char4;
               char1 = test.charAt(0);
               System.out.println();
               System.out.println("Character at position 0 of string test is  " +char1);
               char2 = test.charAt(11);
               System.out.println("Character at position 11 of string test is " +char2);
               char3 = test.charAt(26);
               System.out.println("Character at position 26 of string test is " +char3);
               char4 = test.charAt(34);
               System.out.println("Character at position 34 of string test is " +char4);
                 
            
                  
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            }
         }