JavaRush/Courses/New Java Syntax/Practice with static methods

Practice with static methods

Open

"Hi, Amigo. Here are some interesting tasks involving static methods:"

11
Task
New Java Syntax,  11 level,  4 lecture
Locked
Class counter
Class counter
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
Static methods: int getCatCount() and setCatCount(int)
Static methods: int getCatCount() and setCatCount(int)
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
StringHelper class
StringHelper class
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
Controlling body weight
Controlling body weight
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
ConsoleReader class
ConsoleReader class
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
Calculator
Calculator
11
Task
New Java Syntax,  11 level,  4 lecture
Locked
Distance between two points
Distance between two points
Комментарии (2)
  • популярные
  • новые
  • старые
Для того, чтобы оставить комментарий Вы должны sign in
YaharpY
Уровень 14
15 December 2023, 07:17
Task#5: Instead of duplicating the code to create a BufferedReader in each method, we should have created a private method to handle the common logic, but no... didn't compile. Why?
Dmitrii PlaksunovBackend Developer at Emerging Travel Grou
28 December 2023, 12:47
It'll compile only if you have declared static parameter, cause static methods can't refer to non-static params
private static Scanner s = new Scanner(System.in);