Results 1 to 2 of 2
- 12-16-2011, 09:27 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 1
- Rep Power
- 0
I dont understand how I am supposed to test this in the main method.
Would anyone like to help me? This is just editing a word, the word needs to be user input by the scanner.
Java Code:import java.util.Scanner; public class Word { public static void main(String[] args) { } public String word; public void Word() { String word = ""; } public void Word(String word1) { String word = word1; } public String getWord() { return word; } public void setWord(String newWord) { String word = newWord; } public void getFirstLetter() { String firstLetter = word.substring(0, 1); } public void getLastLetter() { String lastLetter = word.substring(word.length() - 1, word.length()); } public void removeFirstLetter() { String noFirstLetter = word.substring(1, word.length()); } public void removeLastLetter() { String noLastLetter = word.substring(0, word.length() - 1); } public int findLetter (String parameter) { word.indexOf(parameter); return 1; } }
- 12-16-2011, 10:14 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
Re: I dont understand how I am supposed to test this in the main method.
Similar Threads
-
I don't understand what I'm supposed to do...
By colerelm in forum New To JavaReplies: 2Last Post: 10-04-2011, 03:01 AM -
HELP ...DONT UNDERSTAND Error
By ask4soteria in forum New To JavaReplies: 6Last Post: 11-26-2010, 09:43 AM -
i dont understand why i cant run my program please help
By kungfu in forum New To JavaReplies: 3Last Post: 07-28-2010, 02:49 PM -
8 questions I dont understand while studying for SCJP
By shankhas in forum Java CertificationReplies: 5Last Post: 05-19-2010, 07:53 AM -
Dont understand Return Statement.
By ocean in forum New To JavaReplies: 6Last Post: 10-22-2009, 12:06 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks