JAVA – Search File In Folder

class SearchFileInFolder { public void SearchPath(File folder) throws IOException { File[] listOfFiles = folder.listFiles(); if (listOfFiles.length < 1) { System.out.println("\n #---This Folder Empty: "+folder.getAbsolutePath()); } else { System.out.println("\n #---List of Files & Folder: "+folder.getAbsolutePath()); for (File file : listOfFiles) { if(file.isDirectory()) { System.out.println("FOLDER: "+file.getAbsolutePath()); SearchPath(file.getAbsoluteFile()); } if(file.isFile()) { System.out.println("FILE: "+file.getAbsolutePath()); } } } } public static void main(String[] args) throws IOException { SearchFileInFolder obj = […]

Java – Move cursor position (Any System)

import java.awt.Robot; import java.util.Random; public class MouseMover { public static final int FIVE_SECONDS = 5000; public static final int MAX_Y = 400; public static final int MAX_X = 400; public static void main(String… args) throws Exception { Robot robot = new Robot(); Random random = new Random(); while (true) { robot.mouseMove(random.nextInt(MAX_X), random.nextInt(MAX_Y)); Thread.sleep(FIVE_SECONDS); } } }

java HelloWorld

public class HelloWorld {     public static void main(String[] args)     {         System.out.println(“Hello, World”);     } }