Computer Science, asked by neerchaudhary9, 7 months ago

what is instance variable in Java? ​

Answers

Answered by charusharma64
4

Answer:

An instance variable is a variable which is declared in a class but outside of constructors, methods, or blocks. Instance variables are created when an object is instantiated, and are accessible to all the constructors, methods, or blocks in the class. Access modifiers can be given to the instance variable.

this will help you

please do follow me

Answered by Anonymous
2

Explanation:

__________________________________

ᴀɴ ɪɴsᴛᴀɴᴄᴇ ᴠᴀʀɪᴀʙʟᴇ ɪs ᴠᴀʀɪᴀʙʟᴇ ᴡʜɪᴄʜ ɪs ᴅᴇᴄʟᴀʀᴇᴅ ɪɴ ᴄʟᴀss ʙᴜᴛ ᴏᴜᴛsɪᴅᴇ ᴏғ ᴄᴏɴsᴛʀᴜᴄᴛᴏʀs,ᴍᴇᴛʜᴏᴅ ᴏʀ ʙʟᴏᴄᴋs ɪɴsᴛᴀɴᴄᴇ ᴠᴀʀɪᴀʙʟᴇ ᴀʀᴇ ᴀᴄᴄᴇssɪʙʟᴇ ᴛᴏ ᴀʟʟ ᴛʜᴇ ᴄᴏɴsᴛʀᴜᴄᴛɪᴏɴ ᴍᴇᴛʜᴏᴅ ᴏʀ ʙʟᴏᴄᴋs ɪɴ ᴛʜᴇ ᴄʟᴀss

__________________________________

ᴍᴀʀᴋ ᴍᴇ ᴀs ʙʀᴀɪɴʟɪsᴛ

Similar questions