13/04/19 11:08
alex1995
sale, ho ancora probnlemi con gli array in java questo è un array semplice ma mi da errore questo è il mio sorgente:
questo è l' errore:
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Utente */ public class miacalasse { /** * @param args the command line arguments */ public static void main(String[] args) { String prova = "asd"; switch(prova) { case "asd": System.out.println("asd"); break; case "qwe": System.out.println("qwe"); break; default: System.out.println("asdasd"); } String[] pctable = {"monitor"}; for(int i = 0; i < pctable.lenght; i++) { System.out.println(pctable[i]); } } }
questo è l' errore:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol symbol: variable lenght location: variable pctable of type java.lang.String[] at miacalasse.main(miacalasse.java:32) C:\Users\Utente\AppData\Local\NetBeans\Cache.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)
aaa