Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ejemplos2;
- import java.util.ArrayList;
- public class ejercicio6 {
- public static void main(String[] args) {
- ArrayList<String> lista1 = new ArrayList<>();
- lista1.add("hola");
- lista1.add("chao");
- ArrayList<String> lista2 = new ArrayList<>();
- lista2.add("hola");
- lista2.add("chao");
- System.out.println(comparar(lista1, lista2));
- }
- public static boolean comparar(
- ArrayList<String> lista1, ArrayList<String> lista2) {
- boolean retorno = true;
- if (lista1.equals(lista2))
- {
- retorno = true;
- }else{
- retorno = false;
- }
- return retorno;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement