We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Tutorials
- 30 Days of Code
- Day 14: Scope
- Discussions
Day 14: Scope
Day 14: Scope
Sort by
recency
|
1121 Discussions
|
Please Login in order to post a comment
Whats C++11 for??
Code in Python
This is the code in java
Can someone explain to me while the following code only returns zeroes (JAVA):
public int computeDifference(){ Arrays.sort(elements); int len = elements.length-1;
I suppose I know the issue in this. Remove the declaration int for maximumDifference because doing so, it'll create a local variable although it was already declared in the class and during the final output the class-level declared variable is accessed, not the local one.
Scope matters!! 😃
C#