File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
RandomProblems/src/sporadic Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * This is a class to help me understand "CLASS" in java.
3
+ */
4
+ package sporadic ;
5
+
6
+ /**
7
+ * @author SteveSun
8
+ *
9
+ */
10
+ public class UnderstandClass {
11
+
12
+ /**
13
+ *
14
+ */
15
+ public UnderstandClass () {
16
+ }
17
+
18
+ /**
19
+ * @param args
20
+ */
21
+ public static void main (String [] args ) {
22
+ UnderstandClass uc = new UnderstandClass ();
23
+ Class c1 = UnderstandClass .class ;
24
+ Class c2 = uc .getClass ();
25
+ System .out .println (c1 );
26
+ System .out .println (c2 );
27
+ System .out .println (c1 == c2 );
28
+ Class c3 = null ;
29
+ try {
30
+ c3 = Class .forName ("sporadic.UnderstandClass" );
31
+ } catch (ClassNotFoundException e ) {
32
+ e .printStackTrace ();
33
+ }
34
+ System .out .println (c3 );
35
+ System .out .println ("End of the program." );
36
+ }
37
+
38
+ }
You can’t perform that action at this time.
0 commit comments