As we know the following code generates a compile error:

// The following code will generate a compile error since you are
trying to
// invoke a instance method through a class.   Fix this compile error.
        char f = String.charAt(2);

My javadoc lookup works fine and I understand that charAt is an
instance method so not revelant to String. My (rather silly) is
question - what is the fix? My suggestion would be:

String strRandom = "Some random string";
char f = strRandom.charAt(2);

I know it may seem obvious but this just seems too simple!?!?

Andy_D

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to