java - how to declare int as array[] and past the value from main class? -


how can fix problem? want change parameter , pvalue array

import java.util.*; public class test5 {      /**      * @param args command line arguments      */     int parameter[];     int pvalue[];     public test5(int para[], int pv[]){         parameter=para;         pvalue=pv;      }      public void loopi(){          int = 0,j,k,l;         scanner sc=new scanner(system.in);          system.out.print("enter parameter : ");         parameter[i]= sc.nextint();          char group = 'a';         for(i=1;i<=parameter[i];i++)         {             system.out.print("enter parameter value : ");             pvalue[i]=sc.nextint();               for(j=1;j<=pvalue[i];j++)             {                 system.out.print(" "+j+group+" \n");              }            seat++;         }       }      public static void main(string[] args) {         // todo code application logic here          int i[] = null;         int j[] = null;         test5 t=new test5(i,j);         t.loopi();     }  }  

if want arrays command line arguments, need convert of strings in args int, try like

int[] = new int[args.length]; (int = 0; < args.length; i++) {     a[i] = integer.parseint(args[i]); } 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -