File tree Expand file tree Collapse file tree 5 files changed +79
-0
lines changed
src/main/java/com/mycompany/testproject Expand file tree Collapse file tree 5 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "type" : " java" ,
9
+ "name" : " Launch Current File" ,
10
+ "request" : " launch" ,
11
+ "mainClass" : " ${file}"
12
+ },
13
+ {
14
+ "type" : " java" ,
15
+ "name" : " Launch TestProject" ,
16
+ "request" : " launch" ,
17
+ "mainClass" : " com.mycompany.testproject.TestProject" ,
18
+ "projectName" : " TestProject"
19
+ }
20
+ ]
21
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <groupId >com.mycompany</groupId >
5
+ <artifactId >TestProject</artifactId >
6
+ <version >1.0-SNAPSHOT</version >
7
+ <packaging >jar</packaging >
8
+ <properties >
9
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
10
+ <maven .compiler.source>11</maven .compiler.source>
11
+ <maven .compiler.target>11</maven .compiler.target>
12
+ <exec .mainClass>com.mycompany.testproject.TestProject</exec .mainClass>
13
+ </properties >
14
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .mycompany .testproject ;
2
+
3
+ public class Test {
4
+ String name ;
5
+ static String s = "not set" ;
6
+ }
Original file line number Diff line number Diff line change
1
+ package com .mycompany .testproject ;
2
+
3
+ public class TestProject {
4
+ public static void main (String [] args ) {
5
+ System .out .println ("Start" );
6
+ TestProject t = new TestProject ();
7
+ t .assign ();
8
+ t .print ();
9
+ Init init = new Init ();
10
+ init .setStatic ();
11
+ init .print ();
12
+ }
13
+
14
+ void assign () {
15
+ Test test = new Test ();
16
+ test .name = "test" ;
17
+ Test .s = "static" ;
18
+ System .out .println (test .hashCode ());
19
+ }
20
+
21
+ void print () {
22
+ Test test = new Test ();
23
+ System .out .println (test .name );
24
+ System .out .println (Test .s );
25
+ System .out .println (test .hashCode ());
26
+ }
27
+
28
+ }
29
+
30
+ class Init {
31
+ void setStatic () {
32
+ Test .s = "static updated" ;
33
+ }
34
+
35
+ void print () {
36
+ System .out .println (Test .s );
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments