What is Empty Class?
Answers
Answered by
1
Answer:
Empty class means, a class that does not contain any data members e.g. int a , float b and string etc. However, a class can contain member functions. In below example, both classes will be called as an empty class.
Answered by
9
❣️▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃❣️
ɪɴ ᴊᴀᴠᴀ, ᴀ sɪᴍᴘʟᴇ ᴇᴍᴘᴛʏ ᴄʟᴀss ᴏғ ᴊᴀᴠᴀ ғᴏʟʟᴏᴡs ɪɴʜᴇʀɪᴛᴀɴᴄᴇ, ᴀs ɪᴛ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ɪɴʜᴇʀɪᴛs ᴏʙᴊᴇᴄᴛ ᴄʟᴀss, ᴛʜᴇʀᴇғᴏʀᴇ ᴄᴀɴ ᴘᴇʀғᴏʀᴍ ᴛʜᴇ ғᴜɴᴄᴛɪᴏɴᴀʟɪᴛʏ ᴅᴇғɪɴᴇᴅ ɪɴ ᴏʙᴊᴇᴄᴛ ᴄʟᴀss. ɪᴛ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ᴄʀᴇᴀᴛᴇs ᴀ ᴅᴇғᴀᴜʟᴛ ᴄᴏɴsᴛʀᴜᴄᴛᴏʀ ɪɴsɪᴅᴇ ᴛʜᴇ ᴄʟᴀss ᴡɪᴛʜ ᴇᴍᴘᴛʏ ᴅᴇғɪɴɪᴛɪᴏɴ. ғᴏʟʟᴏᴡs ᴘᴏʟʏᴍᴏʀᴘʜɪsᴍ, ᴀs ᴄᴀɴ ʙᴇ ᴜsᴇᴅ ɪɴ ᴀɴʏ ғᴏʀᴍ ʙʏ ᴛʜᴇ ᴇxᴛᴇɴᴅᴇᴅ ᴄʟᴀss......
❣️ ▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃❣️
Similar questions