Results 1 to 5 of 5
Thread: getInitials Method
- 03-04-2012, 11:34 PM #1
Member
- Join Date
- Feb 2012
- Posts
- 57
- Rep Power
- 0
getInitials Method
Hey everyone,
Time for a new set of problems. I'm working on the first and thought I was pretty close. However, when I added in some test coding, I'm getting "cannot find symbol" errors on that part of the code. I want to make sure my method is working correctly and I know it's something stupid that I'm staring right at. Can someone help me figure out why I'm getting the errors? The instructions for the assignment are commented at the beginning of the code.
Here is my code:
Java Code:public class InitialsTest { /** Gets the initials of this name @params first, middle, and last names @return a string consisting of the first character of the first, middle, and last name */ public static String getInitials(String one, String two, String three) { // your work here String initials = one.substring(0, 1) + two.substring(0, 1) + three.substring(0, 1); return initials; } public static void main(String[] args) { System.out.println("Initials are: " + getInitials(John, Jacob, Smith)); } }
- 03-04-2012, 11:48 PM #2
Re: getInitials Method
If you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 03-05-2012, 12:03 AM #3
Member
- Join Date
- Feb 2012
- Posts
- 57
- Rep Power
- 0
Re: getInitials Method
WHOOSH...that's what that page says going right over my head. Anything more specific? (I'm only 6 weeks into this programming class)
- 03-05-2012, 12:39 AM #4
Re: getInitials Method
What does the first sentence after the heading "String Literals" say? Surely that's not over anyone's head.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 03-05-2012, 12:56 AM #5
Member
- Join Date
- Feb 2012
- Posts
- 57
- Rep Power
- 0
Similar Threads
-
problem with using a method's object/variable in another method. Please help!!!
By biodunalfet in forum New To JavaReplies: 1Last Post: 10-27-2011, 08:16 AM -
Whats the different between package.class.method and super.method?
By Pojahn_M in forum New To JavaReplies: 1Last Post: 10-17-2011, 02:00 AM -
Declaring a method inside a method: Runnable?
By africanhacker in forum New To JavaReplies: 8Last Post: 03-23-2011, 05:30 AM -
method not abstract, does not override actionperformed method.
By Theman in forum New To JavaReplies: 2Last Post: 03-26-2010, 06:12 PM -
cannot call private method from static method
By jon80 in forum New To JavaReplies: 3Last Post: 05-07-2008, 09:37 AM
Bookmarks