Java
T
point
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Android
Interview Q
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
Question 1
:
1. class Foo {
2. public int left = 9;
3. public int right = 3;
4. public void setLeft(int leftNum) {
5. left = leftNum;
6. right = leftNum/3;
7. }
8. // lots of complex test code here
9. }
What is the problem with above code ?
1.
Weak encapsulation
2.
No Problem
3.
Strong encapsulation