Monday, April 9, 2018

HCL

1. Can we write generic method without generic class?
Ans : Yes

2. In which case catch/finally will not executed?
Ans: Infinite loop.

3. How method overloading will in typescript?
Ans : When you overload in TypeScript, you only have one implementation with multiple signatures.
class Foo {
    myMethod(a: string);
    myMethod(a: number);
    myMethod(a: number, b: string);
    myMethod(a: string | number, b?: string) {
        alert(a.toString());
    }
}

Only the three overloads are recognized by TypeScript as possible signatures for a method call, not the actual implementation. The implementation signature must be compatible with all the overloads.

Ans https://www.bennadel.com/blog/3339-using-method-and-function-overloading-in-typescript.htm

4. What is partial method and what is the use ?
Ans : Partial method can be used when you are writing a third party library and want to user ccan write the definition of a particular method which you call on specific event. Than we define that method as partial and leave the definition upto user.

5. How to restrict a generic class taking only values type?
Ans :

public class GenericType where T:struct 
{
}
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters

6. MVC application life cycle.
Ans:

7. How view state id will maintain in ASP .Net
Ans :

8. What is ahead of time in angular 2?
Ans :

9. What is live,binding and delegate in jquery?
Ans:
http://elijahmanor.com/differences-between-jquery-bind-vs-live-vs-delegate-vs-on/

No comments:

Followers

Link