javau3p5

import java.util.*; class no_match_exception extends Exception { public no_match_exception(String raw) { super(raw); } } public class pro35 { public static void main(String ar[]) { Scanner sc=new Scanner(System.in); String s1="internet"; try { if(s1.equals(ar[0])) { System.out.println("String match"); } else{ throw new no_match_exception("String is not match"); } } catch(no_match_exception d) { System.out.println(d.getMessage()); } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.