Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package sk.academy.it;
- import java.io.File;
- /**
- *
- * @author IT Academy
- */
- public class VypisAdresar {
- public static void main(String[] args) {
- String aktulnaAdresa = System.getProperty("user.dir");
- File aktualnyAdresar = new File(aktulnaAdresa);
- String[] mena = aktualnyAdresar.list();
- System.out.println("Aktualne subory: ");
- for (String s : mena) {
- System.out.println("- " + s);
- }
- File[] subory = aktualnyAdresar.listFiles();
- System.out.println("\nAktualne subory a velkosti: ");
- for (int i = 0; i < subory.length; i++) {
- System.out.println("- " + subory[i].getName() + " \t"
- + subory[i].length() + " b");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement