What will be displayed on the console?
using System;

public enum Organs: byte 
    None = 0x00, 
    Heart = 0x01, 
    Lung = 0x02, 
    Liver = 0x04 
public class App 
      public static void Main(string[] args) 

          Organs organs = Organs.Lung | Organs.Heart; 
Correct answer: Heart, Lung because attribute Flags changes behavior of enum; without this attribute 3 will be displayed.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes