Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Metodo che ritorna booleano. Se la lista List <Integer> passata come parametro è strettamente
- crescente allora true se no false
- private List<Integer> lista;
- public List<Integer> isCrescente() {
- for(int i=0; i<lista.size()-1; i++) {
- if(lista.get(i)<lista.get(i+1))
- return false;
- return true;
- }
- }
- ERRORI:
- Programma.java:9: error: incompatible types: boolean cannot be converted to List<Integer>
- return false;
- ^
- Programma.java:10: error: incompatible types: boolean cannot be converted to List<Integer>
- return true;
- ^
Add Comment
Please, Sign In to add comment