In Serialization, whether you will use Static variables?
Answers were Sorted based on User's Feedback
Answer / chandramouli
We cannot serialize the static variables because static is
specific to the class not for the objects.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / ranganathkini
Static variables are not serialized during object serialization.
If u want to serialize static fields, then u must use ur own
serialization overrides and implement the
java.io.Externalizable interface on the class.
| Is This Answer Correct ? | 3 Yes | 2 No |
What does provide mean construction?
Can a constructor be protected?
What is difference between ++ I and I ++ in java?
what do you mean by java annotations?
What is the purpose of object oriented programming?
How TreeMap sorts the objects inside it?? suppose if have include one employee object and one car object. On what basis it will sort?
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result? 1 B 2 The code runs with no output. 3 Compilation fails because of an error in line 12. 4 Compilation fails because of an error in line 15.
How do you create a sop?
Define linked list and its features with signature?
If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?
What is an abstract method in java programming?
how to get the max salary and name of employee from arraylist without using the Comperator or even Comparable interface?