Source Code : Annotation Demo

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Annotation Demo

 

public class StringUtility {
@TestParameters(testStage="Unit",
                testMethods="testConcat,testSubstring",
                testOutputType="screen",
                testOutput="")
    public String concat(String s1, String s2)
    {
        return(s1 + s2);
    }

    public String substring(String str, int start, int end)
    {
        return(str.substring(start, end));
    }

    public boolean testConcat()
    {
        String s1 = "test";
        String s2 = " 123";

        return(concat(s1,s2).equals("test 123"));
    }

    public boolean testSubstring()
    {
        String str = "The cat landed on its feet";

        return(substring(str, 4, 3).equals("cat"));
    }
}

           
         
  

Thank with us