This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.EmptyStackException; | |
public class Stack<T> { | |
private ArrayList<T> elements = new ArrayList<T>(); | |
private int size = 0; | |
public int size() { | |
return size; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.*; | |
import javax.servlet.http.*; | |
import java.io.*; | |
import org.junit.*; | |
import org.junit.Test; | |
import static org.junit.Assert.*; | |
import org.mockito.Mockito; | |
import static org.mockito.Mockito.when; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Book { | |
private String titulo; | |
public Book(String titulo) { | |
this.titulo = titulo; | |
} | |
public String getTitulo() { | |
return titulo; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaskResult { | |
double value; | |
public synchronized void set(double value) { | |
this.value = value; | |
} | |
public double get() { | |
return value; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.*; | |
import javax.servlet.http.*; | |
import java.io.*; | |
class IMCModel { | |
public double calculaIMC(String p1, String a1) | |
throws NumberFormatException { | |
double p = Double.parseDouble(p1); | |
double a = Double.parseDouble(a1); | |
double imc = p / (a * a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Book { | |
private String titulo; | |
public Book(String titulo) { | |
this.titulo = titulo; | |
} | |
public String getTitulo() { | |
return titulo; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.ArrayList; | |
public class Main { | |
public static void main(String[] args) { | |
// teste 1 | |
List<Integer> s = new ArrayList<Integer>(); | |
System.out.println(s.isEmpty()); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script src="https://unpkg.com/vue@2"></script> | |
<body> | |
<h3>Uma Simples SPA</h3> | |
<div id="ui"> | |
Temperatura: {{ temperatura }} | |
<p><button v-on:click="incTemperatura">Incrementa</button></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Livro { | |
private String nome; | |
private String autores; | |
private String editora; | |
private String ano; | |
private Livro (String nome, String autores, String editora, String ano) { | |
this.nome = nome; | |
this.autores = autores; | |
this.editora = editora; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
abstract class Veiculo { | |
private String placa; | |
public Veiculo(String placa) { | |
this.placa = placa; | |
} | |
public String getPlaca() { | |
return placa; |
NewerOlder