why assignment is working, but initialization not working ? please explain what is happening in these 3 cases in code.
#include <iostream>
class Fun {
public:
    void set_data_variable()
    {
        y {2};      // case 1 : this doesn't work
        // y = 2;   // case 2 : this does work
        // y = {2}; // case 3:  this also work
        std::cout << y << "\n";
    }
private:
     int y = 6;
};
int main()
{
    Fun f;
    while (1) {
        f.set_data_variable();
    }
    
} 
 
     
    