Most voted "method" questions
A class method is nothing more than a collection of instructions grouped together for the purpose of executing a given task.
Learn more…271 questions
Sort by count of
-
-1
votes2
answers100
viewsWhy is calling a method not compiling?
using System; using System.IO; namespace testando { public class pessoa { public void Falar(){ Console.WriteLine("Ola meu nome é ninguem"); } } …
-
-1
votes1
answer180
viewsWhat is the difference between the ending, Finally and finish in Java?
What is the difference between the terms: final, finally and finalize(), in the programming language Java?
-
-1
votes1
answer307
viewsInput in multiple attributes of a Python class
Hello guys I’m having a question about multiple attributes of functions or methods through the function input. For example: class Pessoa(): def __init__(self, nome, idade): self.nome = nome…
-
-1
votes1
answer418
viewsHow to reverse the order of a String in Dart?
I know that in other languages have methods to get the inverse of a String and I’ve searched Dart, but I’m not finding anything. I’m doing like this: String inverter(String v) { String inverso ='';…
-
-1
votes1
answer279
viewsjava:7: error: invalid method declaration; Return type required
Name of the complete error: Cliente.java:7: error: invalid method declaration; return type required public cliente() { ^ Code I used: import java.net.Socket; public class Cliente extends…
-
-1
votes2
answers100
viewsProblems in creating class and method
I have the following code: public class String verifyWord(String wordChosen, Scanner reader){ //linha 1 boolean answeredCorrectly = false; int tries = 1; String wordChosen = random.nextInt(); String…
-
-1
votes1
answer298
viewsDoubt about toString Java method
I would like to know the difference between using and not using the method toString in Java, because I understood that it serves as a print normal. Has some advantage in using this method ? My…
-
-1
votes1
answer37
viewsforeign key registration method
I’m having trouble with the foreign key. I have a company record and in this register I put 3 foreign keys, which is that such relationship 1:n, right? Anyway, I can only put the columns on the…
-
-1
votes1
answer63
viewsFlutter Dart: return value for a class
When calling the method callReadTotal(), the global variable tot receives the value and it prints without problems its result within it. However, in the class ThemesList called it, the variable…
-
-1
votes0
answers31
viewsDoubt on how to return an object from a method and use it in another class
I’m doubting how to generate an object in a way. I wanted to return the values that are inside the red box, to fill an array with each object of this method. The exit would stay inside the main: My…
-
-2
votes2
answers485
viewsHow can I call a class void method to display an msg in a form
I have a method public void listarProduto(). It needs to have all the user input information. My problem is time to call this method within a MessageBox() in the form for the message to be…
-
-2
votes2
answers1436
viewsTake variable value in another method
Inside the same file I have 2 methods: public IActionResult OnGet(){ CarregarMenu(); //Gostaria de pegar aqui o valor da variável lcMenuPrincipal Return Page(); } And the other: public static void…
-
-2
votes1
answer45
viewsHow do I display attributes of an object stored in an array?
I’m doing a job that consists of fictitious real estate. In this program there is a class called principal where it receives Immovel (Class) and stores the immovables in a vector, a class…
-
-2
votes1
answer1928
viewsHow to invoke a method specific to a PHP class?
I created a class Pen which has the following attributes and methods: <?php class caneta { var $modelo; var $cor; var $ponta; var $carga; var $tampada; function rabiscar() { if ($this->tampada…
-
-2
votes1
answer67
viewsPython: Error in . write() method
I wrote a code that would run on my Desktop. The script would write a text in another directory. To switch directories, I used os.chdir(), then used subprocess.check_output() to execute a shell…
-
-2
votes1
answer428
viewsHow to call a controller method via JS or Ajax in Windows
I’m new with PHP and Laravel, besides I don’t know much about JS. I have the following question, I have a view that displays the information of the service provider of my project, before this guy is…
-
-2
votes0
answers19
viewsHow I call a variable declared in a method
Hello, First I wanted to make it clear that I’m kind of new at programming okay?. Well my problem is that I need to do a method where I ask the user a name, then confirm the name, if the answer is…
-
-3
votes1
answer213
viewsJava Attempt to invoke virtual method error 'android.view.Window$Callback android.view.Window.getCallback()' on a null Object Reference
Folks need a help with an error in a method of my code. Basically I have a Framelayout that loads two Fragments. When starting the APP it loads the first Fragment with 3 Textedits and a button. When…
-
-3
votes1
answer159
viewsHow to perform sales commission calculation
To summarize well what I want, I will do so so that the program should run: Digite o nome do vendedor: Joao Digite a meta do vendedor: 1000 Digite o valor de vendas: 499 After this I need to make…
-
-3
votes0
answers28
viewsWhere is the error in this numerical method?
I’m hours away from finding my mistake in this Jacobi method, I’ve checked with friends, and I can’t find where that mistake could be. The expected outputs are approximately: 0.78, -1.96 , 1.03.…
-
-4
votes1
answer95
viewsWhy are you making a mistake in calling a method?
I’m trying this code: class Car: def beep(): print('Beep') car = Car() car.beep() Typeerror: method() takes 0 positional Arguments but 1 was Given 'Cause there’s a mistake?…