Questions tagged [method-call]

386 questions
-2
votes
1 answer

C# problem trying to add items in combobox via another form

I have this situation: in my form Order there's a combobox with many products inside. it is expected that the user could add products to the combobox to use in Order, but this is made via another form called ProductAdd, basically made with a…
AleMaffe
  • 49
  • 1
  • 7
-2
votes
1 answer

One class calling another's method

In an attempt to tidy up my (very basic) UI code i have split the button and text field into two seperate classes, with a main to create a frame and run. The button needs to affect the contents of the text field when clicked, so i have used a…
-2
votes
3 answers

calling method from another method which takes 3 parameters in the same class

I was writing a code for calculator by creating class name "calculator" which takes methods for add, subtract, multiply and divide. These methods takes two parameters and perform respective action. Now, I have to create another method name…
Ritesh kumar
  • 17
  • 1
  • 3
-2
votes
1 answer

The subprocess.call() function is not working

I was doing an exersize with the following task: Write a python program to call an external command in Python. As I could not solve it by my own I looked up the solution: from subprocess import call call(["ls", "-l"]) But the solution threw an…
-2
votes
2 answers

Passing variable as method argument

I'm working on a linked list code and wanted to access head.next.next.data. Is there a means where I can store .next.next.data to a variable x so that I can make the call head.x and retrieve the result provided I have data populated in the list? I…
-2
votes
1 answer

invoke set method in constructor with scanner

I am trying to invoke a set method in a constructor that accepts user input to instantiate an object. A sample of a set method is as follows: public void setName(String name) { if(name.length()>0 && name.length()<25) { this.name =…
SPerez
  • 1
  • 1
-2
votes
2 answers

Why doesn't my method return anything even though I have print statements?

When I attempt to call the daysInaMonth method in my main method, I get this error: DaysInMonth.java:34: error: missing return statement } ^ 1 error What am I doing incorrectly? Why isn't the method call working? I've made sure that both…
Darien Springer
  • 467
  • 8
  • 17
-2
votes
2 answers

javascript call a method with a name stored onto a variable

I'm very new to js programming. I'm working for test development. I have requirement to call a js function with the name that is store onto a file. For example I have two files, file1.sah //sah is sahi extension but internally the file has…
-2
votes
4 answers

Is it better to call a method on a variable or chain it to the constructor?

There are examples of calling such methods on any class. I.e.: SampleClass sc=new SampleClass(); sc.someMethod(); Or is it better to use new SampleClass().someMethod(); Please, explain in detail.
Chirag.T
  • 746
  • 1
  • 6
  • 18
-2
votes
1 answer

How to start an Activity and call a method of that class using another class

I want to open a class and a method of that class from another class simultaneously. When i click on button it stops the application. Help! Method of class 'Fixtures' from which I want to call class and Method public void onClick(View arg0) { //…
Anuj
  • 39
  • 2
  • 6
-2
votes
1 answer

Method is not called inside the action listener method in java swing

I have to call a method inside the java swing actionperformed method. But when I click the button nothing happens. How to solve this problem? private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { hellocalled(); } …
-3
votes
1 answer

Where can I find a list of batch script options?

I have .bat script file that contains commands like these: call %CONAN_BAT% install cmake/3.21.1@thirdparty/stable -g=virtualenv -if "%BUILD_DIR%" -pr vs2010 Even with google I failed to figure out what anything besides the call command and the…
Dennix
  • 115
  • 1
  • 10
-3
votes
2 answers

Why methods return just one kind of parameter in normal conditions?

i experienced this questions in a during the job interview, but i cant answered it and i cant find the answer after. They asked me 'Why methods return just one kind of parameter in normal conditions in C#? (ref-out is extra way to return multiple…
-3
votes
1 answer

Is go evaluation order between member invocations guaranteed?

Let's say I have a struct with state, and a few member functions on that struct. Let's say that the struct member returns an instance of its own type, and I call additional functions on that instance, and pass the result of calling some other member…
Jon Watte
  • 6,579
  • 4
  • 53
  • 63
-3
votes
1 answer

Overriden method calls original method declared in extension (category) in swift?

My code: extension UIViewController { @IBAction func someFunc() { ... } } class CustomViewController: UIViewController { @IBAction override func someFunc() { ... } } Can CustomViewController.someFunc() call…
1 2 3
25
26