Questions tagged as 'classes'

2
answers

How to adapt / create a method that receives an anonymous class in C #

I have a method in which one of the parameters is an object of an abstract class - ObjectMapper - whose purpose is to convert an object from one class to another from another class. Below, the method signature informs that the objectMapper will...
asked by 17.09.2015 / 17:04
1
answer

Abstract class and properties in C #? [closed]

Hello, everyone! Next, I created an abstract class called Tables, where basic system table classes inherit from this abstract class. Like Neighborhood, City, States, category, etc ... The abstract class code looks like this: public abstract...
asked by 04.02.2016 / 23:44
1
answer

Why use __debugInfo ()?

I saw PHP 5.6 now create the new magic method, called __debugInfo . This method is intended to return a array , so it will be printed on the var_dump call. This array returned obviously should provide debugging infor...
asked by 17.11.2016 / 14:51
2
answers

What is the difference between initializing a constructor or doing assignment inside the constructor?

What's the difference between the two examples below? Should I also assign the value inside the constructor in this class even though I have initialized? Example 1: class sof{ int teste; public: sof(int t) : teste(t){} ); Examp...
asked by 02.12.2016 / 02:39
1
answer

Is there a way to do these assignments more cleanly?

I have a class that should be started with a% of properties. $subscription = new CheckRenew([ 'custom_2_id' => 13, 'email' => '[email protected]', 'zip' => '90530000', 'number' => '1234' ]);...
asked by 29.12.2016 / 20:04
1
answer

Partial for separating events and methods

I have seen in a system a separation of the methods in a partial and the events in another in UserControl and Window as the example below: "Pessoa.xaml.cs" public partial class Pessoa: UserControl { //Construtor //...
asked by 20.04.2016 / 15:58
1
answer

Aggregation relation and class attribute

Does aggregation only occur when a A, class that aggregates a B class has an attribute of type B ? Can aggregation exist without necessarily having one attribute having the type of the other? For example, if I instantia...
asked by 16.12.2015 / 21:57
2
answers

How do I return a new instance of the python class itself dynamically inside it?

I am giving a study in Python and for this I am putting together a Python class that I had already done in PHP. For example, in a given method in PHP I needed to return the same instance of the class dynamically, but without usi...
asked by 18.05.2016 / 20:32
4
answers

function_exists fatal error

Hello, I need help solving this problem. I have the following code snippet (I put the line number to facilitate): **186** if ( function_exists( self::$function_val() ) === TRUE ){ **187** call_user_func( self::$function_val() ); **188**...
asked by 03.04.2017 / 16:01
1
answer

Class creation that returns a String

Hello everyone, I'm a beginner in Java and I'm having a problem, I'm trying to create a class that returns a String . I create the file .java and paste my code but it gives the following error in the declaration String : Sy...
asked by 18.05.2015 / 21:09