Home / C# Programming / Classes and Objects :: Discussion

Discussion :: Classes and Objects

  1. Which of the following will be the correct output for the C#.NET program given below?

     namespace FreshergateConsoleApplication
     {    
        class Sample   
        {        
           int i;      
           Single j;        
           public void SetData(int i, Single j)          
           {          
              i = i;     
              j = j;     
           }    
           public void Display()     
           {           
              Console.WriteLine(i + " " + j);      
           }     
        }      
        class MyProgram    
        {         
           static void Main(string[ ] args)      
           {             
              Sample s1 = new Sample();             
              s1.Se1tData(10, 5.4f);              
              s1.Display();      
           } 
        } 
     }
    

  2. A.

    0 0

    B.

    10 5.4

    C.

    10 5.400000

    D.

    10 5

    E.

    None of the above

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment