---
# System prepended metadata

title: 12/18Lab
tags: [JAVA]

---

# 12/18Lab
###### tags: `JAVA`


 Set set =new TreeSet(new Comparator() {

				@Override
				public int compare(Object o1, Object o2) {
				         File emp1 =(File)o1;
				         File emp2 =(File)o2;
				         if(emp1.length()<emp2.length())
				         {
				        	 return -1;
				        	 
				         }else if (emp1.length()>emp2.length()) {
							 return 1;
						}else{
							return 0;
						}				
				}
				
				
			});
	              	       	       	       	       
	       File[] filessFiles=dir.listFiles();
	       long s=0;
	      for (File file2 : filessFiles) {
	    	  if(!file2.isDirectory())
	    	  {
	    		  s=file2.length();
	    		  set.add(file2);
	    		  System.out.println(file2.getName()+s);
		    	  System.out.println(s);
		    	  
		    	  
	    	  }    	  
			
		}
	      for (Object file2 : set) {
	    
	    		 System.out.println(file2);		
		}