Questions tagged [method-call]
386 questions
0
votes
2 answers
Printing methods from main method not working - Java
So Ive been instructed to write a class that generates an array (with return), sorts the generated array, reverses the sorted array (with return), and then check the sorted to see if any 2 adjacent #'s are the same (return True if there are, or…

Matt Jackson
- 9
- 1
0
votes
2 answers
call Function of Adapter on a Button.setOnclickListner
I want to call onChildRemoved method in CommentAdpter on commentDelete onclickListner as it is a inner class method so it is giving error everywhere where i tried to put setOnclickListner so please tell me how to setOnclickListner to this button so…

Uttam Meerwal
- 324
- 2
- 12
0
votes
1 answer
Why does PyDev require an object in place of Self when calling a class method?
So I am new to Python, but I have seen the recent popularity surround the language so I decided to give it a try and learn the language. I started by developing a simple ArrayList using the PyCharm IDE and I had absolutely no issues at all. Now I…

spstephens
- 75
- 1
- 7
0
votes
4 answers
Java - Auto add method call when developer instantiates an object
I am wondering if it is possible for a developer to write a class so that when some other developer instantiates an object of the aforementioned class, a call on a specific method of the class gets added to his code.
Let me be more specific. Let's…

Lefteris008
- 899
- 3
- 10
- 29
0
votes
1 answer
Sequential calls to long method produces spilling
Hi the title says everything really. I have a method which reads in a file holding data on the composition of materials (like polythene, or the natural composition of lead) each of these materials is held in a different object and each has a…

morb
- 17
- 5
0
votes
0 answers
Eclipse Breakpoint Propertes
In Eclipse, is there a way to toggle breakpoints ON at all the locations of a method call?
For example, I want to add breakpoints at all places where setVisible(boolean) is called.
Thanks in advance

Mahikanth Nag Yalamarthi
- 23
- 1
- 5
0
votes
1 answer
Trying to understand how two same method call placed one after the other in recursive method
Below is an example of quicksort. I was wondering how two recursive method call inside quicksort method works i.e in what sequence it'll execute? So to check in what sequence I placed syso after each method (check output).My doubt why this…

Shashank
- 13
- 7
0
votes
0 answers
Calling a method for *this influences SOMEHOW other parameters, C++
I have two methods:
bigint& bigint::operator=(const bigint& b){
init();
for(int i = N-1; i >= N - b.getLength(); i--){
un[i] = b.un[i];
}
setLength(b.getLength());
return *this;
}
void bigint::init(){
int L =…

Andrew
- 1
- 2
0
votes
3 answers
Java: for loop is breaking before all iteration due to method call
I am facing a bizarre problem. In the below code fragment, the 2nd for loop is breaking after one iteration, when I am calling userRoles.removeRole(strRole). There are 2 elements in the list. The first for loop is executing twice. But the 2nd one is…

NPException
- 59
- 7
0
votes
3 answers
Understanding an object-oriented assignment while working with methods
I'm still new to java and writing/reading code, so I'm not quite sure what my professor wants. All I need is some reinforcement of what I should be doing.
The assignment is as follows:
Specify and then implement a method (of some class X) that is…

JJ Dubz
- 3
- 2
0
votes
1 answer
How would call a function that calls "by-name" as an argument in scala
I'm pretty new to scala and still in the early days of learning. I was reading an article that had an example like so:
def example(_list: List[Positions], function: Position => Option[Path]): Option[Path] = _list match {...}
NB
Position is a…

Kacy
- 3
- 1
0
votes
2 answers
Can't call a function in a Javascript class
I'm writing a THREE.js graphics program and I want to set up a BodyPart class in Javascript with some methods - but I can't call those methods. The code below prints 'calling test', but not 'called test'. I've tried putting the function test outside…

struggling
- 21
- 6
0
votes
1 answer
How to stop method calling a method in another class in Mockito?
I have the following method to test in my Java service class:
public void findPersonToDelete(String id){
//repository method then called
personRepository.findPersonAndDelete(id);
}
The issue is that the personRepository calls other code…

java123999
- 6,974
- 36
- 77
- 121
0
votes
3 answers
Calling a method from another method in which both are in the same class
I am calling the method findRoom() which is in the class myClass from the main method:
int room[]= {1,2,3,4,5,6,7,8,9,10};
String customer[] = {"","Shay","","Yan","Pan","","","Xiao","Ali",""};
myClass m = new myClass();
m.findRoom(customer,…

Dinz_N
- 23
- 1
- 2
- 9
0
votes
3 answers
Getting a random number each time in a script
I'm having trouble with the following bit of code:
from random import randint
class character():
__init__(self):
#init stuff here
def luck(self, Luck = randint(0, 3)):
return Luck
I have to call this method multiple times in…

Bruno Fauth
- 47
- 10