Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

Access Modifiers in C++

Access Modifiers in C++

Access modifiers are constructs that define the scope and visibility of members of a class. There are three access modifiers:

Private

Private members are accessible only inside the class and not from any other location outside of the class.

Protected

Protected members are accessible from the class as well as from the child class but not from any other location outside of the class.

Public

Public members are accessible from any location of the program.
class Test

{ 
private:   int x;  public: int y;
void getdata()
{ 
cout<<”Enter x and y”<<endl; 
cin>>x>>y;
}
void display()
{ 
cout<<”x=”<<x<<”y=”<<y<<endl;
} }

void main()
{ 
clrscr(); 
Test p;
p.getdata(); 
cout<<”Enter  value of x”<<endl; 
cin>>p.x;
cout<<”Enter value of y”<<endl; 
cin>
>
p.y; 
getch();
}


Here the statement “cin>>p.x;” generates an error because x is a private data member because x is a private data member and is not accessible from outside of the class. But the statement “cin>>p.y;” does not generate an error because y is a public data member and is accessible from everywhere. Thus we can say that the use of private access specifier is used to achieve data hiding in class.

Comments

Popular posts from this blog

Array in C Programming | C Programming

C program to Find Cartesian Product of Two Sets | C programming

What is System? | SAD