Questions tagged as 'classes'

1
answer

Strange property initialization

When reading a tutorial on Entity Framework, I came across an example code where there was a line that, for me, is unknown: Student stud = new Student() { StudentName = "New Student" }; I understand that a new object of type Student...
asked by 02.05.2016 / 16:29
1
answer

How to list the class synopsis?

I started to venture into python and am doing program that lists the properties of the classes. I use the obj dic , the help (obj), and the dir (obj). Does anyone know if there is a command that lists the synopses of the methods, something like...
asked by 13.12.2016 / 06:54
3
answers

Vector ordering of objects

I'm making an application that sorts a vector of objects. These objects are Cartesian points, defined in the following class: class CartesianPoint { private: int x; // Coordinate X of a pin or a wire part on a cartesian plan int y; //...
asked by 22.12.2016 / 14:20
4
answers

In C # can I use a local alias for class or namespace?

In languages such as Python or PHP you can use a local alias for classes or namespaces . PHP example: use Vendor\Package\ClassName as C; use Vendor\Package as P; $class = new C; $class = new P\ClassName; Python example: from jso...
asked by 14.06.2016 / 17:51
2
answers

Is a module the same as a class in Python?

Is a module the same as a class? If not what are the differences? I ask this because according to The Zen of Python , modules should be used instead of if s. The problem is that after searching I looked the same.     
asked by 05.03.2015 / 02:08
2
answers

What is the difference between keywords extends and implements in java?

I would like to know when they should be used and how we can distinguish them. I know that basically implements means that this class implements a class or an interface. E extends will be able to access the methods of the base class.     
asked by 28.03.2017 / 13:05
1
answer

Concept of class, entity and objects

I'm reading about classes in C #, and an excerpt left me a bit confused. I know that classes are C # objects, and can be used in many ways. My question is in the following sentence: "A class can have both the attributes and methods of a...
asked by 08.05.2017 / 20:20
2
answers

Why can not I use $ this inside a static class?

In the example below, I wanted to know why I can not use $this inside a static class ? <?php class A{ public static function hello(){ echo 'hello'; } } class B extends A{ public function ok(){ echo...
asked by 16.12.2015 / 04:24
2
answers

Calling function from its name in a PHP class [duplicate]

I'm creating an application where I need to call the function based on its name inside the class. the intention of using it this way is that I can call these functions through ajax and the server will understand without having to do a switc...
asked by 21.12.2015 / 19:46
3
answers

How to set the equality comparison between two objects present in an ArrayList?

How can I set the equality comparison behavior between two objects whose class is defined by me that are stored in an object of type ArrayList? ColorName public class NomeCor { private String nome; public String obterNome() { return no...
asked by 03.04.2017 / 02:55