Advertisement
KeepCoding

IterableTest

Jul 18th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package demo;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.HashSet;
  5. import java.util.List;
  6. import java.util.Set;
  7.  
  8. public class TestingIterable {
  9.     public static void main(String[] args) {
  10.         String[] array = new String [5];
  11. //        Iterable arrayIterable = array; // CTE error
  12.  
  13.         Set<String> set = new HashSet<>();
  14.         Iterable setIterable = set;
  15.  
  16.         List<String> list = new ArrayList<>();
  17.         Iterable listIterable = list;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement