Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can we make a class static without using static keyword?

Answer Posted / shadab alam

yes we can make a class static without using static keyword
We can prove it by following program.

we konw that static member of a class can be accessed by
using the class name now I will do it without static
keyword specify in sub class

Like a.abc.add()
where a is class name and abc is also class name but
without static keyword.But it executed successfully.
this proves that inner class is a static class.


using System;
static class a
{



public static void my()
{
Console.WriteLine("outer class's method");
}
class abc
{


public static void add()
{
Console.WriteLine("Inner class's
method");
}
}
public static void Main()
{

a.my();
a.abc.add();
}


}

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How oops is better than procedural?

1105


Is abstract thinking intelligence?

1057


any one please tell me the purpose of operator overloading

2401


What is pointer in oop?

1063


What is class in oop with example?

1108


Why oops is important?

1130


What is advantage of inheritance?

1178


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

3233


What is inheritance write a program to show use of inheritance?

1149


Why is destructor used?

1032


What is polymorphism and its types?

1074


What are oops methods?

1022


What is new keyword in oops?

1050


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

2160


What are the benefits of oop?

1266