12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package com.company;
- import java.io.IOException;
- public class Main {
- public static void main(String[] args) throws Throwable {
- Bank.setName("Сберыч");
- // Bank.saveClients();
- Bank.loadClients();
- // Bank.saveBills();
- Bank.loadBills();
- Task task = new Task();
- task.start();
- try {
- Server server = new Server();
- server.Run();
- } catch (IOException exception) {
- System.out.println(exception.getMessage());
- }
- task.interrupt();
- task.join();
- }
- }
- class Task extends Thread {
- @Override
- public void run() {
- while (!isInterrupted()) {
- Bank.showClientsInfo();
- try {
- Thread.sleep(5000);
- } catch (InterruptedException exception) {
- System.out.println(exception.getMessage());
- }
- }
- }
- }
|