Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    UK, derby
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java charAt Problem

    I have this code
    Code:
    class TestChaAt {
    
    	public static void main (String [] arguments) {
    
    			String firstName = "Marie";
    			String lastName = "Smith";
    			String firstChar = "";
    
    			firstChar= firstName.charAt(0);
    						System.out.println (firstChar);
    
    
    	}
    }
    I get the error incompatible types, do I need single quotes some where?

    Jake

  • #2
    Regular Coder
    Join Date
    Feb 2004
    Location
    UK, derby
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorted it now, case closed........


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •