Bläddra i källkod

primitive parameters

Yesoda Sanka 6 år sedan
förälder
incheckning
317dd73d9e
3 ändrade filer med 26 tillägg och 0 borttagningar
  1. Binär
      .DS_Store
  2. Binär
      CodeSamples/.DS_Store
  3. 26
    0
      MyFile.md

Binär
.DS_Store Visa fil


Binär
CodeSamples/.DS_Store Visa fil


+ 26
- 0
MyFile.md Visa fil

@@ -0,0 +1,26 @@
1
+PPrimitiveParameters.java program from open  Texas code
2
+
3
+
4
+Class name: PrimitiveParameters
5
+
6
+Methods: go(),falseSwap(int x, int y),moreParameters(int a, int b).
7
+All are static methods with no returns, all  three static methods have input parameters.
8
+
9
+- [ ]  go() method :
10
+ Fields: x and y  .
11
+ Primitive Type : Integer.
12
+Initialize  the values of x and y. Calling the  methods falseSwap(int x, int y),moreParameters(int a, int b)
13
+and print the values before and after each of these methods.
14
+
15
+- [ ] falseSwap(int x, int y)
16
+
17
+Swap the values of x and y using temp field.
18
+Print the values of  x and y before and after.
19
+
20
+- [ ] moreParameters (int a, int b) method
21
+
22
+Product of a and b is assigned to a.
23
+Assigned 12 to b.
24
+Swap  the values of a and b using falseSwap() method.
25
+
26
+Print the values of  a and b.