X

Which of the following statements are correct about the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class Sample { int i, j; public void SetData(int ii, int jj) { this.i = ii; this.j = jj } } class MyProgram { static void Main(string[ ] args) { Sample s1 = new Sample(); s1.SetData(10, 2); Sample s2 = new Sample(); s2.SetData(5, 10); } } }

( 5 )  .  1 Rating  .  5 Attempts
30 views   .  0 comments  .   . 

Download Solution PDF
  1.  The code will not compile since we cannot explicitly use this.

  2.  Using this in this program is necessary to properly set the values in the object.

  3.  The call to SetData() is wrong since we have not explicitly passed the this reference to it.

  4.  The definition of SetData() is wrong since we have not explicitly collected the this reference.

Give Rating
Report

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

Write Your Comments or Explanations to Help Others
Comments(0)



No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Explore Other Libraries

X




Copyright (c) 2021 TuteeHUB

OPEN APP
Channel Join Group Join