oop tag

60 questions


1 answers
136 views
0
I have a question for Python while.

def binary_search(array, goal): low = 0 high = len(array) - 1 while low <= high: mid = (low + high) // 2 if goal > array[mid]: low = mid + 1 elif goal < array[mid]: high = mid - 1 else:...

2 years ago

1 answers
113 views
0
Do I need to put @Override when implementing the method of the interface?

Do I need to put @Override when implementing the method of the interface? Read about @Override in the Java document.@Override indicates that when defining a method, it overrides a higher-class method....


1 answers
79 views
0
There are no conditional statements in the for statement in this code. Why?

I'm changing the C++ algorithm to C#, and I saw a for statement like this. for (u = b.size(), v = b.back(); u--; v = p[v]) b[u] = v;Errors appear on C# and work well on C++.I don't know what this repe...

2 years ago

1 answers
88 views
0
When is else used at the same level as the for / while repetition statement?

for i in range(10): print(i) if i == 9: print(Too big - I'm giving up!) break;else: print(Completed successfully)I don't know why you use else when you have a code like this.At first, I thought the ...


1 answers
126 views
0
What role do __init___ and self play?

I usually speak C language, and sometimes I don't understand Python because it's a habit.What do self and _init__ do in the functions below?Is there any reason why you have to write it down?I think it...

2 years ago

1 answers
114 views
0
When do you use friend in class?

I know the friend declarationI've never used it beforeI don't know when to use it.If you think about the encapsulation of OOP,Isn't friend an exceptional function?

2 years ago

1 answers
83 views
0
I have a question about the development process.

If the developer is alone or a minority, the development will proceed without a DBA.I have been designing and developing DB first, and this method is subject to ever-changing requirements

2 years ago

1 answers
82 views
0
Is there a way to prevent the private field of the class from being modified?

public class Test{ private String[] arr = new String[]{1,2}; public String[] getArr() { return arr; }}When there's a code like this

2 years ago

1 answers
118 views
0
How do I call a parent class function in a child class?

Is there a way to call a member function of a parent class in a child class?How can I implement call_print_in_Base below?class Base{public: void print() { cout << i'm base! << endl; }};cla...

2 years ago

1 answers
80 views
0
Polymorphism and Overriding and Overloading

When someone asked me what polymorphism is...Can overloading or overriding be the answer to that?I think polymorphism needs to be added more than that. The one defined without the implementation of th...

2 years ago
« - 3 - »

© 2024 OneMinuteCode. All rights reserved.