CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Java – How to impose constraints on Generics in Java?

In our previous article, we discussed generics in Java. There are a few constraints that we can impose while working with Generics using extends and super keywords. The ‘extends’ keyword with respect to class Let’s create the Demo<T> class using extends keyword. class Demo<T extends Number> {        T value; } This implies that the class […]

Ruby Programming – Getter and Setter methods

Ruby allows defining class and instance variables. Ruby doesn’t allow us to access the variables of the class directly; instead, we can use methods to access or modify the variables of the class. We have discussed an overview of classes in Ruby through my previous Article “Ruby Programming – An Overview on Classes“. Through this […]

Java – How to use Generics in Java?

Java is a type-safe language. In the sense, in Java, it is required to specify the data type of the variable or the method argument while declaring it. For instance, see the examples below: int var = 5;   //  type of the variable is int void show(String arg){}   // type of the argument arg is […]

MFC – The device context classes

Windows device context is the key GDI element that refers a physical device. Device contexts are used to draw to the physical device; screen, printer, etc,. MFC provides different wrapper classes; and each class is associated with Windows device context. Through this article, we are going to discuss different MFC’s Device Context classes. CDC class […]

Ruby Programming – An Overview on Classes

As we discussed in our previous Articles, Ruby is a pure object-oriented language. That means, everything is an object of a class in Ruby. Non-object things are NOT exists in Ruby. Unlike C++ where you can write the program without classes or objects; in Ruby we CAN NOT write programs without classes or objects. Hence […]

Ruby Programming – The Basics of Ruby

Ruby is a pure object-oriented programming language. That means, everything is an object in Ruby. For example, 3 is an object of Number class. If you type 3.methods; it will return all the methods defined in the Number class. Similarly, if you type 3.class; you will see the type of the class this object is […]

Scroll to top