Created
December 8, 2015 16:13
-
-
Save Yur-ok/5654818319faa0be33d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Lesson2.KeyPoint2; | |
| /** | |
| * Created by Юрий on 08.12.2015. | |
| */ | |
| public class OldEnough { | |
| public static void main(String[] args) { | |
| oldEnough(30); | |
| oldEnough(21); | |
| oldEnough(-21); | |
| } | |
| static boolean oldEnough(int age){ | |
| if (age >= 21) { | |
| System.out.println(true); | |
| } | |
| if (age < 21) { | |
| System.out.println(false); | |
| } | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Но из метода возвращается всегда false. Выводить информацию не обязательно. Возможно метод будет использован другим методам для анализа. Еше раз будьте внимательны к тому, что делаете.