Questions tagged as 'classes'

1
answer

How to tell who a class will extend at runtime?

I have the class public class Conhecimento{} This class extends from another class "CteProc" Only this CteProc class has "versions" example. v200.CteProc v300.CteProc My problem is that in creating the Knowledge class I need to...
asked by 11.09.2017 / 14:45
1
answer

Is there any relevant difference between "Object-oriented programming" and "Class-oriented programming"?

I was reading a post that the member @bigown indicated, and I came across an answer from another member that gave me more questions and decided to search. In the response was the following phrase: "Object-oriented programming" and "class-orie...
asked by 09.05.2017 / 19:55
1
answer

Is it possible to implement an abstract class in PHP without the need for inheritance like in Java?

It is possible to do in PHP "in the same way" the instance of class CachorroAbstract in method main below: public abstract class CachorroAbstract { public abstract void latir(); } public class Main{ public static void mai...
asked by 04.07.2016 / 22:47
1
answer

In python, how can I simulate a read-only property in classes?

I'd like to know how I can simulate a read-only property in Python . For example, I have the following code: class IPInfo(object): def __init__(self, ip): self.ip = ip; ip = IPInfo(object) ip.ip = 'aqui é possível edi...
asked by 20.07.2016 / 18:09
2
answers

How to use operator = to copy a vector of pointers?

Having this class, I would implement, operator =, copy the vector from pointers to int to another vector, is it necessary to reserve memory before doing so? What's the difference between making a builder per copy and implementing the assignme...
asked by 21.12.2016 / 22:05
2
answers

How to implement operator overload and in C ++?

Hello, I'm doing an exercise that consists of the following statement: Sorryforputtingaprint,butIcouldnotselectthetextanditwouldbeanunnecessaryjobtotypeeverythinghere.Finally,Imadetheclassandimplementedtheoverloadofthe+,-,*and/operators,butI...
asked by 02.01.2017 / 22:01
1
answer

What does "Inconsistent modifiers style" mean in Resharper?

Resharper is suggesting the following code change: Note: The classe Pagamento has public methods. Why the suggestion internal and not public ?
asked by 06.12.2015 / 15:48
1
answer

Why should I use File :: copy, if PHP already exists copy?

I'm using Laravel on various projects I use. I needed to copy a particular file from one location to another, and I saw in the Laravel documentation that I should use File::copy() . Out of curiosity, as I always do, I decide...
asked by 06.07.2015 / 18:34
1
answer

How to modify or set a value inside the class in php

I have class in php and I need to modify the value of private $key = "valor"; out of class . How can I change the value of $key outside this class? The value I want to put in $key comes from a $_POS...
asked by 28.06.2015 / 06:08
1
answer

Validate method name, suggesting correct

I'm using an email library class from the framework Nette . At some point, instead of calling the setSubject method - which is the correct method, I called addSubject , since I had forgotten the method name. So the following...
asked by 27.10.2015 / 16:00