Home / Interview / F# :: General Questions

Interview :: F#

31)

What is a self in F#?

In F#, a self is used to refer the current object of class type. Self is the same as this keyword in C# and Java. You can name the self-identifier however you want. You are not restricted to names such as this or self as in .Net languages.

EXAMPLE

32)

What is static in F#?

In F#, static is a keyword. It is used to make the static field or static method. Static is not the part of the object. It has its memory space to store static data. It is used to share common properties among objects.

EXAMPLE

33)

What is an inheritance in F#?

In F#, inheritance is a process in which child class acquires all the properties and behaviors of its parent class automatically. It is used to reuse the code.

EXAMPLE

34)

What is method overriding in F#?

Method overriding is a feature of Object-oriented programming approach. It helps to achieve polymorphism. We can achieve method overriding using inheritance.

EXAMPLE

35)

What is an abstract class?

Abstract classes are used to provide the full implementation of class members. It may contain non-abstract methods. A class that inherits abstract class must provide an implementation of all abstract methods of the abstract class.

EXAMPLE

36)

What is an interface in F#?

F# provides Interface type. It provides pure abstraction. It is a collection of abstract methods.

EXAMPLE

37)

What is type extension in F#?

Type extension allows you to add new members to your previously defined object type.

EXAMPLE

38)

What is a delegate in F#?

In F#, delegates are reference types. It allows us to call the function as an object. It is a feature of this language. It gives an advantage over the other functional programming languages.

EXAMPLE

39)

What is the object expression in F#?

F# object expression is a special expression. It creates a new instance of anonymous object type which is based on an existing base type, interface, or set of interfaces.

EXAMPLE

40)

What is Exception handling?

Exception handling is a standard mechanism to handle abnormal termination of the program. The Exception is a situation that occurs during program execution. It may lead to terminate program abnormally like divide by zero or a null pointer.

EXAMPLE