Results 1 to 2 of 2
  1. #1
    jerryg225 is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Default 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;
    	}
    }

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

Similar Threads

  1. I don't understand what I'm supposed to do...
    By colerelm in forum New To Java
    Replies: 2
    Last Post: 10-04-2011, 03:01 AM
  2. HELP ...DONT UNDERSTAND Error
    By ask4soteria in forum New To Java
    Replies: 6
    Last Post: 11-26-2010, 09:43 AM
  3. Replies: 3
    Last Post: 07-28-2010, 02:49 PM
  4. 8 questions I dont understand while studying for SCJP
    By shankhas in forum Java Certification
    Replies: 5
    Last Post: 05-19-2010, 07:53 AM
  5. Dont understand Return Statement.
    By ocean in forum New To Java
    Replies: 6
    Last Post: 10-22-2009, 12:06 PM

Tags for this Thread

Posting Permissions

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