-1

I want to execute this class from console by "java". I have no problems with compilation, but what do I have to write to call this class? If I don't specify the package, no problems.

package myfirstpackage;
// import myfirstpackage.*;
class MyFirstClass{
    public static void main(String[] args) {
        // MySecondClass msc = new MySecondClass(); 
//      for( int i = 1 , j , size = Integer.parseInt( args[ 0 ] ) ; i <= size ; i++ ){
//          for( j = 1 ; j <= size ; j++ ){
//              msc.setFirst( i );
//              msc.setSecond( j );
//              System.out.printf( "%3d " , msc.multiplyFirtsAndSecond() );
//          }       
//          System.out.println();           
//      }
        System.out.println("A");
    }
}
Gordeev Pavel
  • 25
  • 2
  • 8

1 Answers1

-1

First compilation :

> javac classname.java

And then you can run it

> java classname

Hope it helps

Joachim Huet
  • 422
  • 3
  • 10