Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 7th, 2020 169 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Androide {
  2.  
  3.     private static int tag = 1;
  4.     private String nome;
  5.  
  6.     public Androide() {
  7.         this.nome = "Bob" + tag;
  8.         cambiaTag();
  9.     }
  10.  
  11.  
  12.     public String getNome() {
  13.         return nome;
  14.     }
  15.  
  16.     private static void cambiaTag() {
  17.         if (!isPrimo(++tag)) {
  18.             cambiaTag();
  19.         }
  20.     }
  21.  
  22.     public static boolean isPrimo(int n) {
  23.         if (n == 2 || n == 1) return true;
  24.         if (n % 2 == 0) return false;
  25.         int i = 2;
  26.         do {
  27.             if (n - i == 1) return true;
  28.             if (n % i == 0) {
  29.                 return false;
  30.             }
  31.         } while (i++ < n);
  32.         return true;
  33.     }
  34.  
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top