A method (often called function, routine or procedure) is code that performs a task and is associated with a class or an object.

learn more…| top users | synonyms (1)

0
votes
1answer
25 views

preferred way to modify attributes

I'm using a helper method in my class to modify an attribute, and can see several ways to do this. Are any of the following helper and associated methods preferred or avoided for good reason?class ...
0
votes
0answers
22 views

Unable to call getter for a Runnable in a ArrayList<thread>?

I know I can use callables to get a return value but is it possible to solve this without using it?I am trying to get the tempCounter value from the primeThread and add them all into the counter. ...
0
votes
5answers
37 views

Java method which sums two one dimensional arrays

I am a Java beginner and currently learning for an exam. I got a book with tasks and one task is two write a method, that sums two int arrays if both have the same length. If they do not have the same ...
0
votes
1answer
22 views

JavaFX - Call UI updating methods with pause inbetween

I am working on a JavaFx school project at the moment where I try to move an imageView across a GridPane. The movement should be visualized/updated on the UI sequentially. I tried AnimationTimers ...
0
votes
1answer
39 views

Count prime numbers in arraylist

I'm having an assignment where I need to count the prime numbers in an array list. There are several solutions to this here on Stackoverflow but I need to do it in another way. I have the initializing ...
0
votes
4answers
42 views

Optional Protocol methods in swift without using @objc

Using @objc in swift, we can create an optional methods inside protocol like @objc protocol MyProtocol {@objc optional func anOptionalMethod()}But how to create an optional protocol methods ...
0
votes
0answers
15 views

How to use Functions of another File in Dart / Flutter?

I have a Flutter app where I'm using the flutter_web_view package. I'm using it over several different files and would love to create its own file and simply reference with the _launchwebview ...
-2
votes
2answers
69 views

c# - How to allow specific class call specific method

In my code i need to allow only class EchoProcess call method GetStorePrivateData from class MainData.I thnk it not better way but in this code it work done.How should i do?** In future class ...
1
vote
2answers
23 views

addValueChangeListener doen't trigger in android

I have a app in building proccess in some where i need to get data from FirebaseDatabase and show them in custom list view here my code part of it for onDataChange methodmyDatabase=...
1
vote
5answers
57 views

initializing ArrayList<>() in methods or constructor

import java.util.ArrayList;public class Team { private String name;private ArrayList<Player> team;public Team(String name) {this.name=name;//how come i ...
1
vote
1answer
42 views

How Can I Prevent Template Generation for Objects That Don't Implement a Method

So for the purpose of example let's say I have 3 simple structs, the second of which doesn't contain a bar method:struct one {void foo(const int);void bar();};struct two {void foo(...
-1
votes
1answer
24 views

Multiple methods in class and printing on different condition [on hold]

I am quite new to Java (started just a few days ago) and I need some help.Here I have a code and I know it is unfinished. Ok, I have to create three static methods with same name, but with different ...
-2
votes
1answer
22 views

Trying to calculate BMI with a loop?

I have to do a program that loops the BMI for five people and I use scanner to input the name, weight, and height, but I can't seem to be able to return the output. I'm working with multiple methods....
-4
votes
0answers
25 views

Cannot find symbol (Private constructor with public method accessing it) [duplicate]

public class Chick{private int height;private int weight;private int depth;private char name;private Chick(char n,int h,int w,int d){name=n;height=h;...
0
votes
3answers
50 views

Could I instantiate class of the same child type from parent in Java?

Is there is the way to instantiate class of the same child type from parent in Java?E.g. We have:class Animal {Animal clone() {...} }class Rabbit extends Animal {...}...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,