C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

good questions ..


Posted Date: 02 May 2005      Posted By: Rohit Kochar      Member Level: Silver     Points: 2   Responses: 3



1 .Can you allow class to be inherited, but prevent the method from being over-ridden
2 .Can you inherit multiple interfaces? Yes, why not.
And if they have conflicting method names?
3. How to view datagrid pages randomly?

4 .How many forms can be added in asp.net

5. Is it possible a ASPX page contain more than One Scripting Language?

Thanking you.
Rohit Kochar






Responses

Author: Anil Rajan    02 May 2005Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

hi

1. use sealed method
sealed override public void testA()
{

}
2.yes u can

interface a
{
void display(int x);
}
interface b
{
void display(int x);
}
public class Class3 : a,b
{
public Class3()
{
}
<strong>
void a.display(int x){}
void b.display(int x){}
</strong>
}


5. yes

hope it helps



Author: Kamliesh Nadar    02 May 2005Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

1. If you are not declaring a method as Overridable then you can inherit the class but cannot Override that method. Following code will not compile.

Class A
Public Sub F() ' since Overridable is missing
Console.WriteLine("A.F")
End Sub
End Class

Class B
Inherits A
Public Overrides Sub F()
Console.WriteLine("B.F")
End Sub
End Class


2. See the following example its self explanatory, as you need to explicitly tell which methos implemented belongs to which interface -

Public Interface IA
Sub A()
End Interface

Public Interface IB
Sub A()
End Interface

Public Interface IC
Inherits IA, IB
Sub C()
End Interface

Class A : Implements IC
Public Sub A() Implements IA.A
MsgBox("IAA")
End Sub
Public Sub B() Implements IB.A
MsgBox("IBB")
End Sub
Public Sub C() Implements IC.C
MsgBox("ICC")
End Sub
Public Overridable Sub F()
Console.WriteLine("A.F")
End Sub
End Class

3. ????

5. No you can use only one language at a time.

Regards,



Author: ritesh parikh    02 May 2005Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

4) there may be no of forms but there is only one form in aspx page where u can write <runat = "server">


Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Previous : Is there any expert to solve this?
Return to Discussion Forum
Post New Message
Category: .NET




About Us    Contact Us    Privacy Policy    Terms Of Use