Files
Alexandr Suhininandintellij-monorepo-bot b41164371c [java extract method] make method static by default
GitOrigin-RevId: 3cac9f65131e216cc2dd43fe58bf0cccbcb69839
2022-04-26 04:59:44 +00:00

21 lines
455 B
Java

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Test {
public int test(int x) {
int y = 42;
try {
y = getY(x, y);
} catch (FileNotFoundException e) {
}
return y;
}
private static int getY(int x, int y) throws FileNotFoundException {
new Scanner(new File("file.txt"));
y = y + x;
y = y / x;
return y;
}
}