Point class
This commit is contained in:
parent
0ac8436afa
commit
247ec08bb7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.class
|
||||
*.zip
|
||||
|
3
lab-01/.idea/.gitignore
vendored
Normal file
3
lab-01/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
6
lab-01/.idea/misc.xml
Normal file
6
lab-01/.idea/misc.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
8
lab-01/.idea/modules.xml
Normal file
8
lab-01/.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/lab-01.iml" filepath="$PROJECT_DIR$/lab-01.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
lab-01/.idea/vcs.xml
Normal file
6
lab-01/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
11
lab-01/lab-01.iml
Normal file
11
lab-01/lab-01.iml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
37
lab-01/src/_Point.java
Normal file
37
lab-01/src/_Point.java
Normal file
@ -0,0 +1,37 @@
|
||||
public class _Point {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public _Point(int x, int y){
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
}
|
||||
|
||||
public _Point(){
|
||||
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
|
||||
}
|
||||
|
||||
public void setLocation(int x, int y){
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
}
|
||||
|
||||
public int getX(){ return x; }
|
||||
|
||||
public int getY(){ return y; }
|
||||
|
||||
public void setX(int x){ this.x = x; }
|
||||
|
||||
public void setY(int y){ this.y = y; }
|
||||
|
||||
public String toString(){ return String.format("(%d, %d)", this.x, this.y); }
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user