What is Ideal Design of Class?
Answers were Sorted based on User's Feedback
Answer / venkat
declare variables as Private and methods which accesses
variables as public.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / ershad md sk
Ideal Design of Class is First identity Different Business
Objects and identity Business Data & Business Methods on
which u r working on............Think U are working on
SHAPE class think shape is an object and Draw & erase are
business methods which u should Operate ON..And shape has
Different data objects like Square,Rectangle
Is This Answer Correct ? | 0 Yes | 0 No |
Why call by value prevents parameter value change?
What is a local block?
What is the difference between equals() and?
How strings are created in java?
Explain about method local inner classes or local inner classes in java?
What is difference between overloading and overriding in java?
Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.
What is the difference between static and non-static variables?
What is the purpose of nested class in java?
What is volatile keyword in java
What is the purpose of file class?
What are the characteristics of java?