C# Programming - Classes and Objects - Discussion
Discussion Forum : Classes and Objects - General Questions (Q.No. 2)
2.
Which of the following statements is correct about the C#.NET code snippet given below?
class Sample
{
private int i;
public Single j;
private void DisplayData()
{
Console.WriteLine(i + " " + j);
}
public void ShowData()
{
Console.WriteLine(i + " " + j);
}
}
Discussion:
10 comments Page 1 of 1.
AJESH said:
1 decade ago
What is the range of single data type?
(1)
Prashant said:
1 decade ago
If i is declare inside the class then i is no accessible in another class declaration and for j by default is public.
Jerome Prince said:
1 decade ago
Even-though I declared as private, within this class I can accessible so no error.
Shital said:
1 decade ago
What is is single?
Vipin said:
1 decade ago
Single is data type like float, double in c#.
Kuldeep said:
1 decade ago
What type of data can be stored in the Single type Variable ?
Vinod singh said:
1 decade ago
In single data type variable we can store value type data.
Shouvith said:
1 decade ago
Can you give any example single type data?
Uday said:
1 decade ago
Single is value data type, here we are not declaring static void main, so there is an error.
Okechukwu said:
1 decade ago
@Uday, we mustn't declare static void main in the class shown in the program.
Static void main can be declared in another class embedded within the same program.
Static void main can be declared in another class embedded within the same program.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers