switch statment is right or U find something wrong
Assigning a value to a local variable and then returning that at the end is considered a good practice. Methods having multiple exits are harder to debug and can be difficult to read.
Обсуждают сегодня