Questions tagged as 'classes'

3
answers

Add or Remove Class from a DIV when clicking

Hello everyone, I'm trying to make sure that when I press 1x in the ".PA" packages, it will make the changes: add class .select CSS: #bottaaoPA: Display: Block; CSS: bottaaoPB: Display: None; CSS: bottaaoPC: Display: None; And whe...
asked by 25.01.2016 / 17:27
4
answers

How to return values from a List in C #

I have a class Funcionario that has attributes: CPF , Nome and Salario . I have to create an X amount of instances of this class in a List<> and after that, return to the user the values of this list. Wi...
asked by 03.09.2018 / 14:45
3
answers

Call a method automatically via a class class in .NET

I created a partial class for the model users where I implemented some custom functions, such as a function that takes the first and last name assigned and generates a handle , see example below: namespace E_Learning.Mode...
asked by 04.05.2016 / 17:13
3
answers

Where should I put a calculation method? In the entity itself or in the business class?

I have an architectural doubt, I believe. I need to create a method that receives a date range and an entity on which to perform a search in the period quoted. In fact, to ask this question it matters little what the parameters of this method...
asked by 27.04.2016 / 21:52
3
answers

Global variable in all class functions

Normally when I want to pull a variable that is outside the class, I use global $variavel , but I wanted this variable to be accessible in all functions of the class, so I do not need to "pull" all the functions, how?     
asked by 10.03.2015 / 20:26
1
answer

What is the difference between classes initialized with (and without) __init

I'm a beginner in Python and wanted to understand a difference. The two classes below produce exactly the same result and the variables are publicly the same in both classes: class c(): t = "abc" print (t) for a in range (3):...
asked by 18.09.2018 / 00:06
3
answers

How do I use a constant within a method of a class?

I set a constant in a file and would like to call it inside a method in a class. Example: File: Configuracao.php <?php define('FOO','Hello World'); require_once('Classe.php'); ?> File: Classe.php <?php namespace...
asked by 09.12.2014 / 19:04
3
answers

How to implement custom functionality in a model in .NET?

I needed to implement some functionality in the users model but as you can see right at the beginning this class is automatically generated by Entity, so whenever I update or recreate the model the custom functionality will be lost. Ex...
asked by 04.05.2016 / 16:04
2
answers

Set values inside or outside the method?

I'm studying about passing parameters in PHP. I want, for example, to use a certain method that needs to get two values, I have the following codes: Example 1 In class : class Exemplo { protected $var1, $var2; publ...
asked by 27.05.2016 / 17:59
2
answers

"java.lang.NullPointerException" error in Java

Good afternoon, I have an error on line 17 of main. I have one "Student" object and another "POO1" object. I wrote the following code: Aluno aluno = new Aluno (); Avaliacao poo1 = aluno.getAvaliacao(); To send the notes I wrote this:     //...
asked by 20.03.2017 / 18:54