Why can't you declare a class as protected?
Answer / Gaurav Kumar
In Core Java, classes cannot be declared with the 'protected' access modifier. Only methods and variables can be marked as protected.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by event handling?
What is canonical name in java?
which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None
What is use of map in java?
What is this () in java?
Why spring singleton is not thread safe?
What is the difference between yield() and sleep()?
How do you sort in descending order in java using collections sort?
What is a lightweight component?
What is super constructor?
84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.
Can a class be declared as protected?