Question
Need a fix, and explain code. Why can't b.size access Small? If size = 1 is public shouldn't it be able to be accesssed from
Need a fix, and explain code. Why can't b.size access Small? If size = 1 is public shouldn't it be able to be accesssed from outside the class?
public class Big { private Small s = new Small(); public class Small { } public int size = 1; public static void main(String[] args) { Big b = new Big(); b.size; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Marketing Strategy
Authors: O. C. Ferrell, Michael Hartline
6th edition
1285073045, 978-1285607139, 1285607139, 978-1285677316, 978-1285073040
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App