Questions tagged as 'classes'

2
answers

Operator error can not be applied to method group

I'm trying to print a subtraction of dates using C # with WebForms, but I'm not sure how to correctly enter the attributes in the methods or how to print the method. I'm converting the subtraction of the dates into days because I do not know...
asked by 23.04.2016 / 19:57
4
answers

Call static class method by static variable

In the PHP documentation , I found this code against the scope resolution operator :: <?php class OutraClasse extends MinhaClasse { public static $meu_estatico = 'variável estática'; public static function doisPontosDuplo() {...
asked by 14.12.2015 / 18:00
2
answers

Separating static methods into several classes can have a negative impact?

In organization, it is important to separate the methods into different classes. If we organize the methods into different classes in order to create a better organization, can we have a negative impact on program performance? For example,...
asked by 20.01.2017 / 01:35
2
answers

Use function of a class inside another PHP class

I have two classes, what is the correct way to call a function from another class, so below error returns class DB { public function __construct($user, $password, $database, $host) { $this->user = $user; $this->password =...
asked by 22.05.2014 / 22:45
2
answers

How do I access properties of an object that is inside another object?

In the background I want this output Console.WriteLine(cidade1.casas.dono); to return João using System; namespace arrayteste { public class cidade { public string nome { get; set; } public object cas...
asked by 27.06.2017 / 14:47
2
answers

Operator operation new

I wanted to understand basically what logic behind the objects of the classes that use the new operator for example, I have the following program in D language: import std.stdio; class Hello { public this(){} //construtor public voi...
asked by 15.09.2017 / 06:52
1
answer

What do I need to learn specific classes and methods for a task? [closed]

What do I need to learn about classes and methods in general for Java and Android programming? For example, if I need to display a PDF, how will I learn to do this? We know that there are several classes, no one here could write all the cl...
asked by 02.05.2017 / 16:48
1
answer

Single instance of Class C #

I have a Windows Form with the following code: public partial class frmCadastroPessoaFisica : Form { public frmCadastroPessoaFisica() { InitializeComponent(); } } I would like to create only one instance of this form....
asked by 15.07.2016 / 14:14
2
answers

How to check if a method exists in a class in Python?

How to check if a method exists in a class in Python? Is there a function that does this? class Test(object): def method(self): pass For example, I'd like to check through a condition if a given method exists to call it if...
asked by 07.04.2017 / 01:59
2
answers

Class declaration in Java [duplicate]

Can I declare more than one class in the same file in Java, and if this is possible, is the most correct way to program in this language?     
asked by 29.04.2018 / 14:38