Advertisement
Huntersazzad

quiz1

Nov 3rd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.05 KB | None | 0 0
  1. package TEST;
  2.  
  3. public class quiz1 {
  4.  
  5.     public static void main(String[] args) {
  6. //      Boolean b1 = new Boolean("false");
  7. //      boolean b2;
  8. //      b2 = b1.booleanValue();
  9. //      System.out.println("  "+!b2);
  10. //      System.out.println("  "+b1);
  11. //      if (!b2) {
  12. //      b2 = true;
  13. //      System.out.print("x \n");
  14. //      }
  15. //      if (b1 && b2)
  16. //      {
  17. //      System.out.print(" y ");
  18. //      }
  19. //      System.out.println("z ");
  20. //      int KILO = 125;
  21. //              int LOAD = KILO++;
  22. //      int FINAL = 200%LOAD/3*(14%9-3)/3+3;
  23. //      KILO += LOAD*3;
  24. //      System.out.printf("LOAD-=%d \nkilo=%x\nfinal=%o\n",LOAD,KILO,FINAL);
  25. //     
  26. //      int val =1;
  27. //              do {
  28. //              val++;
  29. //              //System.out.println("val: " + val);
  30. //              ++val;
  31. //              //System.out.println("val: " + val);
  32. //              }while (val++ > 25);
  33. //             
  34. //              System.out.println("val: " + val);
  35. //      int  arr[][]= new int [4][];
  36. //              arr [0]= new int[1];
  37. //              arr[1] = new int[2];
  38. //              arr [2]= new int[3];
  39. //              arr[3] = new int[4];
  40. //             
  41. //              int i, j, k =0 ;
  42. //              for (i = 0; i<4; i++) {
  43. //              for (j=0; j<i+1; j++){
  44. //              arr[i][j] = k;
  45. //              k++;
  46. //              }}
  47. //              for (i = 0;i< 4 ; i++) {
  48. //              for( j = 0; j< i + 1; j++) {
  49. //              System.out.print(" " + arr[i][j]);
  50. //                  k++;}
  51. //              System.out.println();
  52. //  }
  53.         String x = null;
  54.         givenMeAString(x);
  55.         System.out.println(x);
  56.     }
  57.         public static void givenMeAString (String y){
  58.         y = "Hello World";
  59.     }}
  60.  
  61. package TEST;
  62.  
  63. public class quiz {
  64.  
  65.     public static void main(String[] args) {
  66.         // TODO Auto-generated method stub
  67. //      float f1[ ], f2[ ];
  68. //          f1 = new float[11];
  69. //          f2 = f1;
  70. //          System.out.println("F2[0] = " + f2[5]);
  71.         System.out.println("value = " +switchit (1));
  72.         }
  73.                 public static int switchit(int x)
  74.                 {
  75.                 int j = 1;
  76.                 switch (x)
  77.                 {
  78.                 case 1: j++;//1
  79.                 case 2: j++;//2
  80.                 case 3: j++;//3
  81.                 case 4: j++;//4
  82.                 case 5: j++;break;//5
  83.                 //System.out.println("value5  = " +j);
  84.                 default: j++;
  85.                 System.out.println("value  def= " +j);
  86.                 }
  87.                 //System.out.println("value  ret= " +(j+(++x))   +x +j);
  88.                 return ++j + (x*3);
  89.     }
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement