Singular definite nouns either have the suffix -et (neuter), -en (masculine) or -a (feminine). All of these suffixes are definite articles equivalent of the English «the».
You might have heard or read that feminine nouns can be masculine as well as feminine.
-a or -en? Masculine or feminine?
Norway was under Danish rule for 500 years, during which time Danish was the official written language of Norway. The Danes merged the feminine gender with the masculine gender a long time ago, which did not happen in Norwegian. Other Germanic languages such as Icelandic and German also kept the Feminine gender.
In other words, Norwegian dialects all have three genders, including the dialect of Oslo. The only exception is the Bergen dialect which has rendered all feminine nouns masculine, just like the Danes did. In every other dialect the feminine gender is obligatory.
The upper class in Oslo used to speak Danish with an Eastern Norwegian phonology, not using any feminine endings or other -a suffixes at all, in stead using Danish suffixes. This is, however, not very common anymore, and nowadays practically everybody under the age of 50 in Oslo uses the -a suffix for most words of the feminine gender. Even the upper class older generation uses the -a suffix for the following words: «jenta» (the girl), «hytta» (the cabin).
The only Norwegians who would naturally say «jenten» and «hytten» are those from the city of Bergen. In the rest of Norway, most, if not all, use three genders when talking or in informal writing, such as when writing text messages. When writing more formal letters, however, converting feminine endings to masculine endings (emulating the Danes) is still subconsciously regarded as less vulgar and more sophisticated by many Norwegians.
It is, therefore, a good idea to learn how to master the feminine gender and use it, unless you live in Bergen and learn to speak the Bergen dialect. Remember to use feminine possessive pronouns when using the feminine gender: «jenta di» (never «jenten di» or «jenta din»), «hytta mi», «boka si», etc. Only when you are fluent in Norwegian and master all the subtleties and cultural aspects of the language, you can choose to use the masculine ending for feminine nouns when the situation calls for it.
Note that in Oslo, many people use the indefinite article «en» both for masculine and feminine nouns (in stead of «en» for masculine and «ei» for feminine), but they still use feminine endings and pronouns when definite: «en bok» – «boka mi». «En hytte» – «hytta mi». In the written language based on Danish; Bokmål, most feminine nouns can be written as masculine nouns, whereas in the Norwegian dialect based Nynorsk, three genders are obligatory. Read more about nynorsk, bokmål and the different dialects here.