/* package whatever; // don't place package name! */ import java.util.*;import java.lang.*;import java.io.*; /* 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 { Set set = new HashSet(); set.add(new Model()); for (Model model : set) { System.out.println("1"); } }} class Model { }
Standard input is empty
Main.java:15: error: incompatible types: Object cannot be converted to Model for (Model model : set) { ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!