método

Equal sign in Ruby method definition

I came across the following method definitions and would like to know the difference between the first definition and the sec ... sh self[:nome] = novo_nome.sort.map { |b| b[1] }.join(' ') else self[:nome] = novo_nome end end end

What is the difference in using the Equals method for the = = operator?

What is the difference in using the Equals method for the == operator in situations of comparing (1) Value Types and (2) reference types?

How to create a class with attributes and methods in C++?

In Java I know how it does, but in C / C++ it's little different so how to create a class with C++attributes and methods? I' ... Tetes::~Tetes() { //dtor } Where Will I define the attributes and methods and also where do I create the constructor?

Instantiate class or use public methods?

When using a method of a class, there are two approaches: instantiate the class and use the method by the object, or make the ... e = new Cliente(); cliente.cadastrarCliente(); Or make the method static and something like: Cliente.cadastrarCliente();

How to overwrite equals method?

I'm trying to overwrite the equals method to instead validate if one Integer object is equal to the other just check if a val ... ria retornar true } } Apparently I'm making a mess of taking the "this" which is the value of object before the .equals.

Overwrite methods based on name only

I'm creating an abstract base class to provide a pattern for other classes. Methods of the base class must be overwritten in ... e a method of the base class independent of the parameters, that is, only based on the name of the method. Is this possible?

Why is it possible to define two or more methods with the same name in the same class in C#?

I'm starting my studies in C # with ASP.NET MVC today. I'm still adapting with some things I'm not used to seeing as I know l ... ing of this" duplication " of the name of the methods? Does this have anything to do with polymorphism or something similar?

How do I run a method at the end of each method of my C Class#

Has a parent and a child class and would like to execute a certain method, as an event, always at the end of each child class method call. How can I do it?

How to call a method inside a System.out.println?

Has how to call a method inside a System.out.println(" ");? Follow My Code: package ExerciciosReferenciaDeObjetos; pu ... +this.media()); /**no caso estou querendo chamar o método da média dentro do system.out... , mas está dando erro**/ }

When should we declare a method as static?

As a general rule it is considered bad programming practice to use static methods. But in what situations is it justified(or ... ivo.txt') Already in static form I would call the method directly: variavel texto = Arquivo.lerArquivo('C:/arquivo.txt')

Why in Java is the size of an array an attribute and a String and a method?

In Java, the size of a array of any object can be obtained with length, which would be an attribute. But in the case of Stri ... le: int[] a = {1,2}; String b = "str"; String[] c = {"aa", "bb"}; a.length; b.length(); c.length;

How to fix this error "Cannot convert from 'int'to' char []'

Why is this error presented? I believe the logic is right.

How many parameters should a method have?

What is the maximum number of parameters a method should have? When should one consider that there are too many parameters? ... nd what to do in this case? Tupiniquim and object-oriented version of the question: design-how many parameters are too many?

What is the purpose of The Clone magic method?

In PHP we have the magic method __clone. It serves to define a behavior when you clone an object, through the Keyword clone. ... n object? Why do some libraries use __clone to clone a property corresponding to an instance of an object (as in Example 2)?

Direct method call on instance

I came across something that doesn't seem to make sense, when I try to make the method call of a direct object in its instanc ... e call Works $eu = new Pessoa("Vinicius"); print $eu->getNome(); Is there an error in the syntax of the first example?

Why is it mandatory to implement " public static void main (String [] args)"?

Why is it mandatory to implement this method in a Java application?

How and when to use "Shadows " and"Overrides"?

How and when to use Shadows e Overrides? What are the recommendations for use for each and in what context to use them?

How to calculate 2^n and (2^n)+1 in java?

I'm doing a job where I have to do some calculations with stacks and I need to do tests for powers of two and powers of two p ... , 8, 9, 16, 17, etc. The part of the powers of two is done easily, but how do I loop or loop for the powers of two plus one?

How to use runOnUiThread()

I am studying using Threads, aSynkTasks and Handlers and came across this method, runOnUiThread () How does this method be ... ent Runnable() inside this method as in this example: runOnUiThread(new Runnable()) public void run(){ // alguma coisa}