Skip to content

Commit

Permalink
Merge pull request Kronv3rk#3 from Maximizer07/develop
Browse files Browse the repository at this point in the history
Lab1
  • Loading branch information
Kronv3rk authored Sep 1, 2020
2 parents c638e82 + f3f429a commit 0333075
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions FirstProject.iml
Original file line number Diff line number Diff line change
@@ -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>
Binary file added out/production/FirstProject/com/mirea/lab1/Ball.class
Binary file not shown.
Binary file not shown.
Binary file added out/production/FirstProject/com/mirea/lab1/Dog.class
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions src/com/mirea/lab1/Ball.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.mirea.lab1;

public class Ball {
private int radius;
public void setRadius(int radius) {
this.radius = radius;
}
public double getRadius() {
return radius;
}
@Override
public String toString(){
return "Ball "+ radius;
}
}
16 changes: 16 additions & 0 deletions src/com/mirea/lab1/Book.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mirea.lab1;

public class Book {
private String name;

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString(){
return "Book "+name;
}
}
17 changes: 17 additions & 0 deletions src/com/mirea/lab1/Dog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.mirea.lab1;

public class Dog {
private int age;

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}
@Override
public String toString(){
return "Dog "+age;
}
}
18 changes: 18 additions & 0 deletions src/com/mirea/lab1/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.mirea.lab1;

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Ball ball = new Ball();
Book book = new Book();
Dog dog = new Dog();
ball.setRadius(in.nextInt());
book.setName(in.next());
dog.setAge(in.nextInt());
System.out.println(ball.toString());
System.out.println(book.toString());
System.out.println(dog.toString());
}
}

0 comments on commit 0333075

Please sign in to comment.