im new to java, ROOKIE... i was doing arraylist example and i compiled it on IDE it worked perfectly, i did that example on CMD it gave me an error
Note: Practice.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
so i used my googling power and googled everything, i found a answer,
by the way this is the code im talking about...
import java.util.*;
public class Practice{
public static void main(String[] args){
ArrayList mylist = new ArrayList();
mylist.add("Maisam Bokhari");
mylist.add("Fawwad Ahmed");
mylist.add("Ali Asim");
mylist.add("Maheen Hanif");
mylist.add("Rimsha Imtiaz");
mylist.add("Mugheer Mughal");
mylist.add("Maaz Hussain");
mylist.add("Asad Shahzada");
mylist.add("Junaid Khan");
System.out.println("Name of the student: "+mylist);
}
}
it work perfectly on IDE (netbeans) but it gave those 2 errors on cmd
many people all over the internet and stackoverflow said that define the data type when creating an ArrayList object
ArrayList< String > mylist = new ArrayList<>();
i did this and it worked perfectly on CMD too... :)
now my question is this which i cant find on the internet
what is the difference between IDE compiling and command line tools compiling?
( i remember when i used to compile my C code in turboC and when i shifted to code::blocks i had to change some code to adjust the compiler , is this same thing ? but java was platform independent )