value tag

17 questions


1 answers
146 views
0
Can I put the default value in the parameter in Java?

public MyParameterizedFunction(String param1, int param2) { this(param1, param2, false); } public MyParameterizedFunction(String param1, int param2, boolean param3) { //use all three parameters here...


1 answers
80 views
0
To return one or more values in a function

What kind of method do you use to return multiple values in a function?The method I'm using is as follows.def f(x): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return (y0,y1,y2)When there are more elements, i...


1 answers
127 views
0
How do I return to generic type in the method?

If you look at the same example below in the OOP book, If you have an Animal class, each animal has several friends. And the subclasses are Dog, Duck, Mouse, etc. Each of them makes a bark(), a quack(...

2 years ago

1 answers
60 views
0
Why does a++++b show an error?

int main (){ int a = 5,b = 2; printf(%d,a+++++b); return 0;}error: lvalue required as increment operandThe code above cannot be executed, but if you write a++++b together, it will be executed, right?W...

2 years ago

1 answers
88 views
0
Is there an easy way to initialize the entire C/C++ array to -1?

int array[100] = {0};I heard that the entire silver element is set to zero, so I thought I just need to set oneint array[100] = {-1};So the first element is minus 1, and the rest is zero.I don't want ...


1 answers
108 views
0
What is the default for Boolean in Java?

What is the default for Boolean in Java?

2 years ago

1 answers
145 views
0
Which is Java, pass-by-reference or pass-by-value?

I've always thought that Java is a pass-by-reference. But I saw a blog claiming it wasn't. (Here's a link: http://javadude.com/articles/passbyvalue.htm)I don't know the difference. Please explain.


2 answers
97 views
0
Question when passing the value from the main to the fragment.

The main sent a String value to the second screen through the int. On the second screen, three tabs and a viewfager are used, and each tab is made up of fragments.However, when you click a button on t...


1 answers
95 views
0
Java pass by reference

What is the difference between the two codes below?Code A:Foo myFoo;myFoo = createFoo();CreateFoo method public Foo createFoo(){ Foo foo = new Foo(); return foo;}Code B:Foo myFoo;createFoo(myFoo);publ...


1 answers
97 views
0
A Comparison of the Concept of C++ Reference Format and Parent-Child Overriding in Java

I'm studying c++ for the first time! When there is a function test that overrides the function of A in B when A is a child class, parent B is a child class, A ref = new B; ref.test();I thought that fu...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.