Created
December 6, 2016 09:01
-
-
Save JonathanParser/e89571ea63c6b4f4850511f308dd0e62 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 JavaGeegbrain; | |
/** | |
* Created by Jack Sparrow on 02.12.2016. | |
*/ | |
public class Lesson1 { | |
public static void main (String[] args){ | |
byte x = 127; | |
short y = 32767; | |
int z = 2147483647; | |
long q = 15000L; | |
char w = 12; | |
float e = 120.0f; | |
boolean r = true; | |
double t = 15.72d; | |
int a = 10; | |
int b = 15; | |
int c = 155; | |
int d = 18; | |
int howyear = 2016; | |
System.out.println("Обьевили переменые всех пройденых типов"); | |
System.out.println("Вызываем метод summa и получаем результат "+summa(a,b,c,d)); | |
System.out.println("Вызываем метод check результат "+check(a,b)); | |
checgod(howyear); | |
} | |
public static int summa(int a, int b, int c, int d){ | |
return a*(b+( c / d)); | |
} | |
public static boolean check(int a, int b){ | |
if (a+b>=10 && a+b<=20) | |
return true; | |
else | |
return false; | |
} | |
public static void checgod (int howyear){ | |
if ((howyear % 4 == 0 && howyear % 100 != 0) || howyear % 400 == 0) | |
System.out.println("Год "+howyear+ " Високосный "); | |
else | |
System.out.println("Год " + howyear + " НЕвисокосный "); | |
} | |
/** | |
* Created by Jack Sparrow on 06.12.2016. | |
*/ | |
public static class Lesson2 { | |
} | |
} |
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 JavaGeegbrain; | |
/** | |
* Created by Jack Sparrow on 06.12.2016. | |
*/ | |
public class Lesson2 { | |
public static void main(String[] args) { | |
int[] arr = { 1, 1, 0, 0, 1, 0, 1, 1, 0, 0 }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment