Good day, friends. I'm just starting to get acquainted with Java. And then a question came up. There are, in addition to the main method, two more. In one of these two, there is a variable that I need to use in another method, but it does not see it, if I just write it, let's say if (choice = 1) { dir_kor(); } if (choice = 1) { dir_kor(); } Maybe I somehow didn’t ask the question, you forgive me, but I think that it’s understandable Please help)
`public class Battleship { public static void main(String[] args) { choice_dir(); if (dir = 1) } void choice_dir() { int rm_min = 1; int rm_max = 2; int dir = rm_min + (int) (Math.random() * rm_max); } } `