Overriding occurs when a derived class contains its own implementation of a method rather than using the base class method. Only one catch block can execute when an exception is caught, then control transfers to finally and remaining code. Public, static, and void are access modifiers - public and static make variables or methods globally accessible, while void specifies a method returns no value.
Overriding occurs when a derived class contains its own implementation of a method rather than using the base class method. Only one catch block can execute when an exception is caught, then control transfers to finally and remaining code. Public, static, and void are access modifiers - public and static make variables or methods globally accessible, while void specifies a method returns no value.
Overriding occurs when a derived class contains its own implementation of a method rather than using the base class method. Only one catch block can execute when an exception is caught, then control transfers to finally and remaining code. Public, static, and void are access modifiers - public and static make variables or methods globally accessible, while void specifies a method returns no value.
If the derived class contains its own implementation of the method
rather than using the method in the base class, the process is called overriding 2.
Can multiple catch blocks be executed?
No, Multiple catch blocks can't be executed. Once the proper catch code executed, the control is transferred to the finally block and then the code that follows the finally block gets executed.
3. difference between public, static and void?
All these are access modifiers in C# Public: Public declared variables or methods are accessible anywhere in the application Static: Static declared variables or methods are globally accessible without creating an instance of the class Void: Void is a type modifier that states that the method or variable does not return any value.