Top "Class" questions

A template for creating new objects that describes the common state(s) and behavior(s). NOT TO BE CONFUSED WITH CSS CLASSES.

How do you create a static class in C++?

How do you create a static class in C++? I should be able to do something like: cout << "…

c++ oop class syntax static
How to call a function within class?

I have this code which calculates the distance between two coordinates. The two functions are both within the same class. …

python class function call
PHP Fatal error: Cannot redeclare class

Does anyone know what can cause this problem? PHP Fatal error: Cannot redeclare class

php class fatal-error
When should you use a class vs a struct in C++?

In what scenarios is it better to use a struct vs a class in C++?

c++ oop class struct ooad
ES6 class variable alternatives

Currently in ES5 many of us are using the following pattern in frameworks to create classes and class variables, which …

javascript class ecmascript-6
How to getElementByClass instead of GetElementById with JavaScript?

I'm trying to toggle the visibility of certain DIV elements on a website depending on the class of each DIV. …

javascript class toggle getelementbyid getelementsbyclassname
Static constant string (class member)

I'd like to have a private static constant for a class (in this case a shape-factory). I'd like to have …

c++ string class static constants
Compare two objects with .equals() and == operator

I constructed a class with one String field. Then I created two objects and I have to compare them using == …

java class object methods equals
How can I select item with class within a DIV?

I have the following HTML: <div id="mydiv"> <div class="myclass"></div> </div&…

javascript jquery html class jquery-selectors