Solution.class.getClassLoader().getResourceAsStream(args[1]);
What do this line?getResourceAsStream(args[1]);
Dyskutowane
Komentarze (1)
- Popularne
- Najnowsze
- Najstarsze
Musisz się zalogować, aby dodać komentarz
Gellert Varga
29 listopada 2021, 22:08
It's just an elaborate complication to make this code harder to understand.
This code:
InputStream iS = Solution.class.getClassLoader().getResourceAsStream(args[0]);
is equivalent to writing this:
InputStream iS = new FileInputStream(args[0]);
(if args[0] in both cases above is the name of an existing file.)
+2