Home / C# Programming / Namespaces :: Discussion

Discussion :: Namespaces

  1. Which of the following C#.NET code snippets will correctly print "Hello C#.NET"?

  2. A.
     import System; 
     namespace FresherGateConsoleApplication
     {   
         class MyProgram  
         {       
             static void Main(string[] args)      
             {             
                 Console.WriteLine("Hello C#.NET");           
             }   
         } 
     }
    B.
     using System;
     namespace FresherGateConsoleApplication
     {    
         class MyProgram  
         {      
            static void Main(string[ ] args)    
            {         
               WriteLine("Hello C#.NET");     
            }     
        }  
     }
    C.
      using System.Console;
      namespace FresherGateConsoleApplication
      {    
          class MyProgram   
          {       
             static void Main (string[ ] args)    
             {         
                WriteLine("Hello C#.NET");      
             }  
          }
       }
    D.
     using System;
     namespace FresherGateConsoleApplication
     {   
          class MyProgram 
          {       
              static void Main(string[] args)   
              {       
                  Console.WriteLine("Hello C#.NET");            
              } 
          }
       }

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment