PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.4
Code Block Pro – Beautiful Syntax Highlighting v1.27.4
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / java.sample

java.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.4, at build/shiki/samples/java.sample

37 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import java.awt.Rectangle;
2
3 public class ObjectVarsAsParameters
4 { public static void main(String[] args)
5 { go();
6 }
7
8 public static void go()
9 { Rectangle r1 = new Rectangle(0,0,5,5);
10 System.out.println("In method go. r1 " + r1 + "\n");
11 // could have been
12 //System.out.prinltn("r1" + r1.toString());
13 r1.setSize(10, 15);
14 System.out.println("In method go. r1 " + r1 + "\n");
15 alterPointee(r1);
16 System.out.println("In method go. r1 " + r1 + "\n");
17
18 alterPointer(r1);
19 System.out.println("In method go. r1 " + r1 + "\n");
20 }
21
22 public static void alterPointee(Rectangle r)
23 { System.out.println("In method alterPointee. r " + r + "\n");
24 r.setSize(20, 30);
25 System.out.println("In method alterPointee. r " + r + "\n");
26 }
27
28 public static void alterPointer(Rectangle r)
29 { System.out.println("In method alterPointer. r " + r + "\n");
30 r = new Rectangle(5, 10, 30, 35);
31 System.out.println("In method alterPointer. r " + r + "\n");
32 }
33
34 }
35
36 // From https://www.cs.utexas.edu/~scottm/cs307/javacode/codeSamples/ObjectVarsAsParameters.java
37