Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. 1)
  2. Masz połączyć wszystkie słowa w słowniku w jedno długie słowo, której metody użyjesz?
  3. Uzasadnij
  4. odpowiedź.
  5. a)
  6. public static void SumOfStrings(ref string allWords, string wordToAdd)
  7. {
  8. allWords = allWords + wordToAdd;
  9. }
  10. b)
  11. public static void
  12. SumOfStrings(ref StringBuilder allWords, string wordToAdd)
  13. {
  14. allWords.Append(wordToAdd);
  15. }
  16. 2)
  17. Znajdź błąd w poniższym kodzie:
  18. public sealed class Vehicle
  19. {
  20. public int TopSpeed { get; set; }
  21. public virtual void Move()
  22. {
  23. /@ Interaction logic for Move @/
  24. }
  25. }
  26. public sealed class Bike : Vehicle
  27. {
  28. public int TopSpeed { get; set; }
  29. private override void Move()
  30. {
  31. base.Move();
  32. }
  33. }
  34. 3)
  35. Dlaczego poniższy kod nie skompiluje się? Co należy zrobić, żeby był poprawny?
  36. public static T GetObjectOrNull<T>(bool getNull)
  37. {
  38. if (getNull)
  39. {
  40. return null;
  41. }
  42. else
  43. {
  44. return new T();
  45. }
  46. }
  47. 4)
  48. Jakie warunki musi spełniać klasa MyClass, aby poniższa linijka kodu była poprawna?
  49. var myObject = new MyClass { 42 };
  50. 5)
  51. Czym różnią się zmienne poprzedzone słowem kluczowym var w języku JavaScript i C#?
  52. 6)
  53. W jaki sposób usunąć
  54. zduplikowane rekordy z tabeli?
  55. declare @t table (x int)
  56. insert into @t values (1)
  57. insert into @t values (1)
  58. insert into @t values (2)
  59. insert into @t values (2)
  60. insert into @t values (2)
  61. insert into @t values (3)
  62. 7)
  63. Jak wykorzystując jQuery można zliczyć liczbę lat po kliknięciu przycisku Sumuj i wyświetlić jako alert.
  64. <script src="https://code.jquery
  65. .com/jquery
  66. -
  67. 2.1.4.js"></script>
  68. <table id="usersTable">
  69. <tr>
  70. <th>#</th>
  71. <th>Name</th>
  72. <th>Age</th>
  73. </tr>
  74. <tr>
  75. <td>1</td>
  76. <td>Kowalski</td>
  77. <td><input type="text"/></td>
  78. </tr>
  79. <tr>
  80. <td>2</td>
  81. <td>Malinowski</td>
  82. <td><input type="text"/></td>
  83. </tr>
  84. </table>
  85. <button id="sum" type="button" >Sumuj</button>
  86. 8)
  87. Ja wygląda de
  88. finicja CSS, która poniższe bloki div
  89. <div class="
  90. wrapper
  91. ">
  92. <div class="
  93. left
  94. -
  95. top
  96. >Top
  97. </div>
  98. <div
  99. class="
  100. center”
  101. >Cente
  102. red
  103. </div>
  104. <div class="
  105. right
  106. -
  107. bottom">Bottom
  108. </div>
  109. </div>
  110. ułoży w ten sposób
  111. :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement