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
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
interface Channel { | |
void send(String msg); | |
String receive(); | |
} | |
class TCPChannel implements Channel { | |
public void send(String m) { | |
System.out.println("Enviando via TCP > " + m); | |
} | |
public String receive() { |
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; | |
import java.util.Iterator; | |
class Subject { | |
private List<Observer> observers = new ArrayList<Observer>(); | |
public void addObserver(Observer observer) { | |
observers.add(observer); | |
} |
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
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 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; |
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; |
NewerOlder