---
title: "Can you have an inner class inside a method and what variables can you access?"  
description: "Can you have an inner class inside a method and what variables can you access?"  
author: "Pushpendra Singh"  
published: 2010-10-25  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/173/can-you-have-an-inner-class-inside-a-method-and-what-variables-can-you-access  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Can you have an inner class inside a method and what variables can you access?

yes, we can have an inner class inside a method and final \
variables can be accessed.\

## Answers

### Answer by Pushpendra Singh

yes, we can have an inner class inside a method and final \
variables can be accessed.\


---

Original Source: https://www.mindstick.com/interview/173/can-you-have-an-inner-class-inside-a-method-and-what-variables-can-you-access

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
