Java Programing error in cmd -


import ppp.*; public class main{     public static void main(string args[]){       pp obj=new pp();       obj.show();    } } 

this simple program gives error :

cannot access pp ppp(package) contains class file (pp.class) , it's on desktop main.java on desktop. 

you have right package pp; in class pp

here revised code

package ppp;  public class pp {      public static void main(string...a)     {         system.out.println("hello");     }     public void show()     {     system.out.println("hello");     }  } 

and here main class

import ppp.*;  public class main{     public static void main(string args[]){       pp obj=new pp();       obj.show();    } } 

it you


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -