Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Can we access the non-final local variable, inside the local inner class?
Home
JAVA
Can we access the non-final local variable, inside the local inner class?
0
votes
asked
May 5, 2021
in
JAVA
by
SakshiSharma
Can we access the non-final local variable, inside the local inner class?
#non-final-local-variable
local-variable
java
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 5, 2021
by
SakshiSharma
No, the local variable must be constant if you want to access it in the local inner class.
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: What are the types of inner classes (non-static nested class) used in Java?
asked
May 5, 2021
in
JAVA
by
SakshiSharma
#inner-class
java
Java-questions-answers
+1
vote
Q: Which one will be preferred in postman- a global variable or a local variable?
asked
May 19, 2021
in
POSTMAN
by
rajeshsharma
local-variable
global-variable
postman-variable
0
votes
Q: How can we access some class in another class in Java?
asked
May 2, 2021
in
JAVA
by
sharadyadav1986
#access-class
class
java
Java-questions-answers
0
votes
Q: Which of the following is true about the anonymous inner class?
asked
Apr 8, 2021
in
JAVA
by
SakshiSharma
java
java-questions-and-answers
java-mcq
core-java-mcq
java-multiple-choice-questions
java-questions-2021
java-interview-questions
java-advanced-questions
Java-questions-answers
0
votes
Q: In which process, a local variable has the same name as one of the instance variables?
asked
Apr 8, 2021
in
JAVA
by
SakshiSharma
java
java-questions-and-answers
java-mcq
core-java-mcq
java-multiple-choice-questions
java-questions-2021
java-interview-questions
java-advanced-questions
Java-questions-answers
0
votes
Q: Mention what are the rules for local and global variables in Python?
asked
Jan 1, 2021
in
Python
by
SakshiSharma
#python-global-variable
local-variable
Python-questions-answers
+2
votes
Q: How can we create an immutable class in Java?
asked
May 4, 2021
in
JAVA
by
SakshiSharma
#immutable-class
java
Java-questions-answers
0
votes
Q: Can the Interface be final?
asked
May 2, 2021
in
JAVA
by
sharadyadav1986
java
interface
Java-questions-answers
0
votes
Q: What are anonymous inner classes?
asked
May 5, 2021
in
JAVA
by
SakshiSharma
#anonymous-class
java
Java-questions-answers
0
votes
Q: Is there any difference between nested classes and inner classes?
asked
May 5, 2021
in
JAVA
by
SakshiSharma
nested-class
inner-class
java
Java-questions-answers
...