Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0408832

Browse files
understand class in java
1 parente7add79 commit0408832

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* This is a class to help me understand "CLASS" in java.
3+
*/
4+
packagesporadic;
5+
6+
/**
7+
* @author SteveSun
8+
*
9+
*/
10+
publicclassUnderstandClass {
11+
12+
/**
13+
*
14+
*/
15+
publicUnderstandClass() {
16+
}
17+
18+
/**
19+
* @param args
20+
*/
21+
publicstaticvoidmain(String[]args) {
22+
UnderstandClassuc =newUnderstandClass();
23+
Classc1 =UnderstandClass.class;
24+
Classc2 =uc.getClass();
25+
System.out.println(c1);
26+
System.out.println(c2);
27+
System.out.println(c1 ==c2);
28+
Classc3 =null;
29+
try {
30+
c3 =Class.forName("sporadic.UnderstandClass");
31+
}catch (ClassNotFoundExceptione) {
32+
e.printStackTrace();
33+
}
34+
System.out.println(c3);
35+
System.out.println("End of the program.");
36+
}
37+
38+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp