Finalmente terminei
This commit is contained in:
57
atividade-4/.classpath
Normal file
57
atividade-4/.classpath
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="target/generated-sources/annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
0
atividade-4/.mvn/jvm.config
Normal file
0
atividade-4/.mvn/jvm.config
Normal file
0
atividade-4/.mvn/maven.config
Normal file
0
atividade-4/.mvn/maven.config
Normal file
34
atividade-4/.project
Normal file
34
atividade-4/.project
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>atividade-4</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1757442411998</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
4
atividade-4/.settings/org.eclipse.core.resources.prefs
Normal file
4
atividade-4/.settings/org.eclipse.core.resources.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
2
atividade-4/.settings/org.eclipse.jdt.apt.core.prefs
Normal file
2
atividade-4/.settings/org.eclipse.jdt.apt.core.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.apt.aptEnabled=false
|
||||
9
atividade-4/.settings/org.eclipse.jdt.core.prefs
Normal file
9
atividade-4/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||
org.eclipse.jdt.core.compiler.compliance=17
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=17
|
||||
4
atividade-4/.settings/org.eclipse.m2e.core.prefs
Normal file
4
atividade-4/.settings/org.eclipse.m2e.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
90
atividade-4/pom.xml
Normal file
90
atividade-4/pom.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.aula.pessoas</groupId>
|
||||
<artifactId>atividade-4</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>atividade-4</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit</groupId>
|
||||
<artifactId>junit-bom</artifactId>
|
||||
<version>5.11.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Optionally: parameterized tests support -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||
<plugins>
|
||||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</plugin>
|
||||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</plugin>
|
||||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.12.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
BIN
atividade-4/src/main/Pessoas.png
Normal file
BIN
atividade-4/src/main/Pessoas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
13
atividade-4/src/main/java/Main.java
Normal file
13
atividade-4/src/main/java/Main.java
Normal file
@@ -0,0 +1,13 @@
|
||||
import com.aula.pessoas.*;
|
||||
|
||||
public class Main {
|
||||
static public void main(String[] argv) {
|
||||
Pessoa pessoa = new Pessoa("Nicolas", 100);
|
||||
Aluno aluno = new Aluno("Fabio", 18, "2011.0.2810.2922-8");
|
||||
Professor professor = new Professor("Alexandre", 33, 28000.22);
|
||||
|
||||
pessoa.imprimirInfo();
|
||||
aluno.imprimirInfo();
|
||||
professor.imprimirInfo();
|
||||
}
|
||||
}
|
||||
26
atividade-4/src/main/java/com/aula/pessoas/Aluno.java
Normal file
26
atividade-4/src/main/java/com/aula/pessoas/Aluno.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.aula.pessoas;
|
||||
|
||||
public class Aluno extends Pessoa {
|
||||
private String matricula;
|
||||
|
||||
public Aluno(String nome, int idade, String matricula) {
|
||||
super(nome, idade);
|
||||
|
||||
this.matricula = matricula;
|
||||
}
|
||||
|
||||
public String getMatricula() {
|
||||
return matricula;
|
||||
}
|
||||
|
||||
public void setMatricula(String matricula) {
|
||||
this.matricula = matricula;
|
||||
}
|
||||
|
||||
public void imprimirInfo() {
|
||||
System.out.println("-----------------------");
|
||||
super.imprimirDados();
|
||||
System.out.println("\tMatricula: " + matricula);
|
||||
System.out.println("-----------------------");
|
||||
}
|
||||
}
|
||||
39
atividade-4/src/main/java/com/aula/pessoas/Pessoa.java
Normal file
39
atividade-4/src/main/java/com/aula/pessoas/Pessoa.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.aula.pessoas;
|
||||
|
||||
public class Pessoa {
|
||||
protected String nome;
|
||||
protected int idade;
|
||||
|
||||
public Pessoa(String nome, int idade) {
|
||||
this.nome = nome;
|
||||
this.idade = idade;
|
||||
}
|
||||
|
||||
public String getNome() {
|
||||
return nome;
|
||||
}
|
||||
|
||||
public void setNome(String nome) {
|
||||
this.nome = nome;
|
||||
}
|
||||
|
||||
public int getIdade() {
|
||||
return idade;
|
||||
}
|
||||
|
||||
public void setIdade(int idade) {
|
||||
this.idade = idade;
|
||||
}
|
||||
|
||||
protected void imprimirDados() {
|
||||
System.out.println("Informação da pessoa:");
|
||||
System.out.println("\tNome: " + nome);
|
||||
System.out.println("\tIdade: " + idade);
|
||||
}
|
||||
|
||||
public void imprimirInfo() {
|
||||
System.out.println("-----------------------");
|
||||
imprimirDados();
|
||||
System.out.println("-----------------------");
|
||||
}
|
||||
}
|
||||
25
atividade-4/src/main/java/com/aula/pessoas/Professor.java
Normal file
25
atividade-4/src/main/java/com/aula/pessoas/Professor.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.aula.pessoas;
|
||||
|
||||
public class Professor extends Pessoa {
|
||||
private double salario;
|
||||
|
||||
public Professor(String nome, int idade, double salario) {
|
||||
super(nome, idade);
|
||||
this.salario = salario;
|
||||
}
|
||||
|
||||
public double getSalario() {
|
||||
return salario;
|
||||
}
|
||||
|
||||
public void setSalario(double salario) {
|
||||
this.salario = salario;
|
||||
}
|
||||
|
||||
public void imprimirInfo() {
|
||||
System.out.println("-----------------------");
|
||||
super.imprimirDados();
|
||||
System.out.printf("\tSalário: %.2f\n", salario);
|
||||
System.out.println("-----------------------");
|
||||
}
|
||||
}
|
||||
19
atividade-4/src/test/java/com/aula/pessoas/AppTest.java
Normal file
19
atividade-4/src/test/java/com/aula/pessoas/AppTest.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.aula.pessoas;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest {
|
||||
|
||||
/**
|
||||
* Rigorous Test :-)
|
||||
*/
|
||||
@Test
|
||||
public void shouldAnswerWithTrue() {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user