Java April 2023 Solution 2nd semester

2nd sem New syallbus

Q11: Find the Second Largest Integer in an Array

Q12: Use of final Data Member, Method, and Class

  • Final Data Member: Once assigned a value, it cannot be changed.
  • Final Method: Prevents method overriding in subclasses.
  • Final Class: Prevents inheritance of the class.

 

Q13: Why Do We Need Wrapper Classes?

Wrapper classes are used to:

  1. Convert primitive types into objects (Autoboxing).
  2. Work with collections (e.g., ArrayList requires objects, not primitives).
  3. Provide utility methods (e.g., Integer.parseInt(), Double.valueOf()).

Q14: Check if a Character Is an Alphabet

Q15: Example Program of Inner Class

Q16:  Containing a Generic Class

Q.no 17

Q,no 18

Q.no 19

 

Leave a Reply

Your email address will not be published. Required fields are marked *