Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {

        String str1 = "java2s", str2 = "java2s.com";

        boolean retval = str1.matches(str2);

        System.out.println("Value returned = " + retval);

        retval = str2.matches("com");

        System.out.println("Value returned = " + retval);

        retval = str1.matches("java");

        System.out.println("Value returned = " + retval);
    }
}