Pergunta de entrevista da empresa Sapiens

Define Inheritance, Polymorphism, Encapsulation, Encapsulation. Find the number of occurrences of a character in a String ? How to find out if the given two strings are anagrams or not ?