About Me

Age:25 --- B.E.(Computer Science), Android/Java Developer, CCNA, CCNA SECURITY (IINS), CCNP (R&S), 4011 Recognized(NSA & CNSS)U.S.A. , MCSA, MCTS, REDHAT CERTIFIED NETWORK SECURITY ADMINISTRATOR(RH253), AFCEH.

Thursday, September 26, 2013

Compilation and Execution of program with Different File and Class name in Java and C#:

       




      
          Java     
          ----                         
              
-> File_Name: Test.java 

  class Hello{
  
      public static void main(String[] args){

           System.out.println("Hello");

      }
  }  
           



Compile:
-------  
         javac Test.java

Run:
---      java Hello      // Using the Class name which contains the main() method.


   

           C#
          ----

-> File_Name: Test.cs


  class Hello                                
  {
   static void Main()
   {
     System.Console.WriteLine("Hello");
   }
  }




Compile:
-------  csc.exe Test.cs
  
Run:
---      Test.exe     // Using the File name itself for compile as well as running it.



      
 

No comments:

Post a Comment