I have to test Java
I was told in my class that I have to write and test my code in the main method, I wrote it, but I dont know how to test it. How I am supposed to test my methods?  I am supposed to take user input, and then get the get the first letter, last letter, etc.


    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;
    	}
    }
I have to test Java
===

I was told in my class that I have to write and test my code in the main method, I wrote it, but I dont know how to test it. How I am supposed to test my methods?  I am supposed to take user input, and then get the get the first letter, last letter, etc.


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