MathRandom.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.sf.day02;
  2. /**
  3. * 随机数
  4. */
  5. public class MathRandom {
  6. public static void main(String[] args) {
  7. // for(int i= 0 ;i <100;i++){
  8. // double random = Math.random(); //[0,1) //左闭右开的
  9. // System.out.println(random);
  10. // }
  11. /**
  12. * //[1,6]
  13. */
  14. /**
  15. * if(){
  16. *
  17. * }else{
  18. *
  19. * }
  20. */
  21. if(3 ==5 ){
  22. System.out.println("true");
  23. }else {
  24. System.out.println("false");
  25. }
  26. if(3 ==5 ){
  27. System.out.println("true");
  28. } else if (3==4) {
  29. System.out.println("true");
  30. }else if (3==4) {
  31. System.out.println("true");
  32. }else if (3==4) {
  33. System.out.println("true");
  34. }else {
  35. }
  36. int age = 18;
  37. if(age >= 18){
  38. System.out.println("成年");
  39. }
  40. if(age < 18){
  41. System.out.println("未成年");
  42. }
  43. if(age >=18){
  44. System.out.println("成年");
  45. }else {
  46. System.out.println("未成年");
  47. }
  48. if(age >=18){
  49. System.out.println("成年");
  50. } else if (age < 18) {
  51. System.out.println("未成年");
  52. }
  53. }
  54. }