/* package whatever; // don't place package name! */ import java.util.*;import java.lang.*;import java.io.*;import java.net.*; /* Name of the class has to be "Main" only if the class is public. */class Ideone{ public static void main (String[] args) throws java.lang.Exception { URL aURL = new URL("pinterest://test/"); System.out.println("protocol = " + aURL.getProtocol()); }}
Standard input is empty
Standard output is empty
Exception in thread "main" java.net.MalformedURLException: unknown protocol: pinterest at java.net.URL.<init>(URL.java:600) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at Ideone.main(Main.java:13)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!