Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.61 KB | None | 0 0
  1. public class Main {
  2.     public static void main(String[] args) {
  3.  
  4.         //moja pierwsza deklaracja
  5.         //typ nazwa;
  6.         int liczba = 5;
  7.         int liczba2 = 10;
  8.         int wynik = liczba + liczba2;
  9.         System.out.println(liczba + liczba2);
  10.  
  11.         //tekst
  12.  
  13.         String powitanie = "Cześć ";
  14.         System.out.println(powitanie.charAt(powitanie.length() - 1));
  15.         System.out.println(powitanie.length());
  16.  
  17. //        char znak = 'a';
  18.  
  19.  
  20.         double liczbazmiennoprzecinkowa = 5.9;
  21.  
  22.         int przepisz = (int) liczbazmiennoprzecinkowa;
  23.  
  24.         System.out.println(przepisz);
  25.  
  26.  
  27.         // ==
  28.         // <
  29.         // >
  30.         // <=
  31.         // >=
  32.         // !=
  33.  
  34. //sout   < ---System.out.println();
  35.  
  36. //        double srednia = 3;
  37. //
  38. //        if(srednia >= 5) {
  39. //            System.out.println("Nowy komputer! i7 + 64gb ram + 2TB SSD");
  40. //        }else if(srednia >= 4){
  41. //            System.out.println("Nowy komputer! 57 + 8gb ram + 256gb SSD");
  42. //        }else if(srednia >= 3.5){
  43. //            System.out.println("Uzywany komputer z i5 4gen 4gb ram + HDD 1TB");
  44. //        }else{
  45. //            System.out.println("Nie ma nowego komputera :(");
  46. //        }
  47.         for (int i = 0; i < 5; i++) {
  48.             System.out.println("TEST!");
  49.         }
  50.     }
  51. }
  52.  
  53. // kopiuj -> ctrl + c
  54. // wklej -> ctrl + v
  55. // wytnij -> ctrl + x
  56. // zmiana koloru tła -> ctrl + tylda
  57. // cofnij -> ctrl + z
  58. // cofnij cofnięcie -> ctrl + shift + z
  59. // uruchom aplikację -> shift + f10
  60. // komentowanie -> ctrl + /
  61. // duplikowanie linii -> ctrl + d
  62. // formatowanie kodu -> ctrl + alt + l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement