1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package com.sf.day02;
- /**
- * 随机数
- */
- public class MathRandom {
- public static void main(String[] args) {
- // for(int i= 0 ;i <100;i++){
- // double random = Math.random(); //[0,1) //左闭右开的
- // System.out.println(random);
- // }
- /**
- * //[1,6]
- */
- /**
- * if(){
- *
- * }else{
- *
- * }
- */
- if(3 ==5 ){
- System.out.println("true");
- }else {
- System.out.println("false");
- }
- if(3 ==5 ){
- System.out.println("true");
- } else if (3==4) {
- System.out.println("true");
- }else if (3==4) {
- System.out.println("true");
- }else if (3==4) {
- System.out.println("true");
- }else {
- }
- int age = 18;
- if(age >= 18){
- System.out.println("成年");
- }
- if(age < 18){
- System.out.println("未成年");
- }
- if(age >=18){
- System.out.println("成年");
- }else {
- System.out.println("未成年");
- }
- if(age >=18){
- System.out.println("成年");
- } else if (age < 18) {
- System.out.println("未成年");
- }
- }
- }
|