## GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN ENGINEERING - SEMESTER 4 - EXAMINATION - SUMMER 2026

| Subject Name: Object Oriented Programming-Java                                                                                       | Subject Name: Object Oriented Programming-Java                                                                                       | Subject Name: Object Oriented Programming-Java                                                                                                                                                                                            |                 |
|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
| Time: 10:30 AM TO 01:00 PM                                                                                                           | Time: 10:30 AM TO 01:00 PM                                                                                                           | Time: 10:30 AM TO 01:00 PM                                                                                                                                                                                                                |                 |
|                                                                                                                                      |                                                                                                                                      |                                                                                                                                                                                                                                           | Total Marks: 70 |
| Instructions :                                                                                                                       | Instructions :                                                                                                                       | Instructions :                                                                                                                                                                                                                            |                 |
| 2. MakeSuitable assumptions wherever necessary                                                                                       | 2. MakeSuitable assumptions wherever necessary                                                                                       | 2. MakeSuitable assumptions wherever necessary                                                                                                                                                                                            |                 |
| 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted. | 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted. | 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted.                                                                                                      |                 |
| 5. English version is authentic.                                                                                                     | 5. English version is authentic.                                                                                                     | 5. English version is authentic.                                                                                                                                                                                                          |                 |
| Q.1                                                                                                                                  | (a)                                                                                                                                  | List any Six application of Java Language.                                                                                                                                                                                                | 03              |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૧                                                | ( અ )                                                                                                                                | GLYPH<c=1,font=/QOBAAA+ShrutiRegular>વા ભાષાના કોઈપણ છ ઉપયોગોની યાદGLYPH<c=19,font=/QOBAAA+ShrutiRegular> બનાવો.                                                                                                                                     | ૦૩              |
|                                                                                                                                      | (b)                                                                                                                                  | List different types of operators in Java, Explain Arithmetic Operator in detail with example.                                                                                                                                            | 04              |
|                                                                                                                                      | ( બ )                                                                                                                                | GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામાં િવિવધ GLYPH<c=26,font=/QOBAAA+ShrutiRegular>કારના ઓપરGLYPH<c=29,font=/QOBAAA+ShrutiRegular> ટરોની યાદ GLYPH<c=19,font=/QOBAAA+ShrutiRegular> બ ન ાવો, ઉદ ાહરણ સાથે એ%રથમે%ટક                                  | ૦૪              |
|                                                                                                                                      |                                                                                                                                      | ઓપરGLYPH<c=29,font=/QOBAAA+ShrutiRegular> ટર  સ મ GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ો.                                                                                                                                               |                 |
|                                                                                                                                      | (c)                                                                                                                                  | Write a program in Java to find sum and average of an array element.                                                                                                                                                                      | 07              |
|                                                                                                                                      | ( ક )                                                                                                                                | એરGLYPH<c=29,font=/QOBAAA+ShrutiRegular> એ&લમે(ટનો સરવાળો અને સરGLYPH<c=29,font=/QOBAAA+ShrutiRegular>રાશ શોધવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામા ં GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ામ લખો. | ૦૭              |
|                                                                                                                                      |                                                                                                                                      | અથવા                                                                                                                                                                                                                                       |                 |
|                                                                                                                                      |                                                                                                                                      | OR                                                                                                                                                                                                                                        |                 |
|                                                                                                                                      | (c)                                                                                                                                  | Write a program in Java to add two 3*3 matrices.                                                                                                                                                                                          | 07              |
|                                                                                                                                      | ( ક )                                                                                                                                | બે 3*3 મે%0સીસ ઉમેરવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામા ં GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ામ  લખો.                                                                                       | ૦૭              |
| Q.2 GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૨                                            | (a)                                                                                                                                  | Explain any Three Principals of Object-Oriented Programming.                                                                                                                                                                              | 03              |
|                                                                                                                                      | ( અ )                                                                                                                                | ઑ234ટ-ઓ%રએ(ટGLYPH<c=29,font=/QOBAAA+ShrutiRegular>ડ GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ાિમ 7ગ ના કોઈપણ 8ણ િસ9ા ંતો સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                               | ૦૩              |
|                                                                                                                                      | (b)                                                                                                                                  | Explain Method Overloading with example.                                                                                                                                                                                                  | 04              |
|                                                                                                                                      | ( બ )                                                                                                                                | ઉદાહરણ સાથે મેથોડ ઓવરલો%ડ7ગ સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular>વો.                                                                                                                                                                           | ૦૪              |
|                                                                                                                                      | (c)                                                                                                                                  | Write a JAVA program to demonstrate use of following 'String' class methods: charAt ( ) toUpperCase ( ) toLowerCase ( )                                                                                                                   | 07              |
|                                                                                                                                      |                                                                                                                                      | નીચેની '=>0?ગ' 4લાસ મેથોડનો ઉપયોગ દશા@વવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વા GLYPH<c=26,font=/QOBAAA+ShrutiRegular>ો,ામ લખો: charAt ( )                                                                  | ૦૭              |
|                                                                                                                                      | ( ક )                                                                                                                                |                                                                                                                                                                                                                                           |                 |
|                                                                                                                                      |                                                                                                                                      | toUpperCase ( )                                                                                                                                                                                                                           |                 |
|                                                                                                                                      |                                                                                                                                      | toLowerCase ( )                                                                                                                                                                                                                           |                 |

OR

| Q.2                                                                                   | (a)   | Explain 'static' keyword with example.                                                                                                                                                                                  | 03   |
|---------------------------------------------------------------------------------------|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૨ | ( અ ) | '>ટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> % ટક'  કGLYPH<c=19,font=/QOBAAA+ShrutiRegular> વ ડ @ ન ે  ઉ દ ા હરણ   સ ાથ ે સ મ GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ો.                                                        | ૦૩   |
|                                                                                       | (b)   | Explain Constructor Overloading with example.                                                                                                                                                                           | 04   |
|                                                                                       | ( બ ) | ઉદાહરણ સાથે ક(>0ટર ઓવરલો%ડ7ગ સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular>વો.                                                                                                                                                      | ૦૪   |
|                                                                                       | (c)   | Write a JAVA program that demonstrate Use of Access Modifiers.                                                                                                                                                          | 07   |
|                                                                                       | ( ક ) | એ4શેશ મો%ડફાઇર નો ઉપયોગ દશા@વવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વા GLYPH<c=26,font=/QOBAAA+ShrutiRegular>ો,ામ લખો.                                                                  | ૦૭   |
| Q.3                                                                                   | (a)   | Explain Wrapper Class with example.                                                                                                                                                                                     | 03   |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૩ | ( અ ) | Vેપર 4લાસ ઉદાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular>વો.                                                                                                                                                              | ૦૩   |
|                                                                                       | (b)   | Explain Single Inheritance with example.                                                                                                                                                                                | 04   |
|                                                                                       | ( બ ) | ઉદાહરણ સાથે િસ7ગલ ઇનહGLYPH<c=29,font=/QOBAAA+ShrutiRegular>રGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ટંશ સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ો.                                                                            | ૦૪   |
|                                                                                       | (c)   | Write a program in Java to demonstrate use of 'super' keyword.                                                                                                                                                          | 07   |
|                                                                                       | ( ક ) | Wુપર કGLYPH<c=19,font=/QOBAAA+ShrutiRegular> વ ડ @   ન ો ઉપયોગ દશા@વવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ા GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ામ  લ ખ ો.                   | ૦૭   |
| Q.3                                                                                   | (a)   | How to Take User Input in Java by Using Scanner Class? Explain with example.                                                                                                                                            | 03   |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૩ | ( અ ) | GLYPH<c=1,font=/QOBAAA+ShrutiRegular>વાની Yદર Zુસર પાસેથી કઈ રGLYPH<c=19,font=/QOBAAA+ShrutiRegular>તે ઈન[ ુટ લઈ સકાય? ઉદાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular>વો.                                                        | ૦૩   |
|                                                                                       | (b)   | Explain Multilevel Inheritance with example.                                                                                                                                                                            | 04   |
|                                                                                       | ( બ ) | ઉદાહરણ સાથે મ]ટGLYPH<c=19,font=/QOBAAA+ShrutiRegular>લેવલ ઇનહGLYPH<c=29,font=/QOBAAA+ShrutiRegular> રGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ટંશ  સ મ GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ો.                                | ૦૪   |
|                                                                                       | (c)   | Create a Java program to create a user-defined package containing at least one class. Import this package in another program and demonstrate the usage of the class and its methods.                                    | 07   |
|                                                                                       | ( ક ) | ઓછામાં ઓછો એક 4લાસ ધરાવ^ું Zુઝર-%ડફાઇ(ડ પેકGLYPH<c=29,font=/QOBAAA+ShrutiRegular>જ બનાવવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વા                                                           | ૦૭   |
|                                                                                       |       | GLYPH<c=26,font=/QOBAAA+ShrutiRegular>ો,ામ બનાવો. આ પેકGLYPH<c=29,font=/QOBAAA+ShrutiRegular>જને બીGLYPH<c=1,font=/QOBAAA+ShrutiRegular>  GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ામ મ ા ં આ યાત કરો અને 4લાસ અને તેની પ9િતઓનો ઉપયોગ દશા@વો. |      |
| Q.4                                                                                   | (a)   | Explain Method Overriding with example.                                                                                                                                                                                 | 03   |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૪ | ( અ ) | ઉદાહરણ સાથે મેથોડ ઓવરરાઇ%ડ7ગ સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular>વો.                                                                                                                                                        | ૦૩   |
|                                                                                       | (b)   | Explain throw keyword with example.                                                                                                                                                                                     | 04   |
|                                                                                       | ( બ ) | throw કGLYPH<c=19,font=/QOBAAA+ShrutiRegular> વ ડ @ ન ે ઉ દ ાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                            | ૦૪   |
|                                                                                       | (c)   | Create a Java program to demonstrate exception handling using built-in exceptions (divide by zero).                                                                                                                     | 07   |
|                                                                                       | ( ક ) | &બ]ટ-ઇન એ4સેપસન(bૂ(યથી ભાગાકાર કરો) નો ઉપયોગ કરGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ને એ4સેપસન                                                                                                                                    | ૦૭   |
|                                                                                       |       | હGLYPH<c=29,font=/QOBAAA+ShrutiRegular> (ડ&લ7ગ દશા@વવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ા GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ામ   બ ન ાવ ો.                             |      |
|                                                                                       |       | અથવા                                                                                                                                                                                                                     |      |
| Q.4                                                                                   | (a)   | Explain 'final' keyword with example.                                                                                                                                                                                   | 03   |

|                                                                                       | ( અ )   | 'final' કGLYPH<c=19,font=/QOBAAA+ShrutiRegular> વ ડ @ ન ે ઉ દ ાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                                                                                                                                                  | ૦૩   |
|---------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
|                                                                                       | (b)     | Explain throws keyword with example.                                                                                                                                                                                                                                                                                                            | 04   |
|                                                                                       | ( બ )   | throws કGLYPH<c=19,font=/QOBAAA+ShrutiRegular> વ ડ @ ન ે ઉદ ાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                                                                                                                                                    | ૦૪   |
|                                                                                       | (c)     | Write a Java program to create a new ArrayList and add 5 students name in that ArrayList.                                                                                                                                                                                                                                                       | 07   |
|                                                                                       | ( ક )   | નhું એરGLYPH<c=29,font=/QOBAAA+ShrutiRegular> લ ી >ટ બ નાવવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ા  GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ા મ   લ ખ ો  અ ન ે ત ે એ રGLYPH<c=29,font=/QOBAAA+ShrutiRegular> લ ી>ટમ ા ં  5 િવjાથkઓના નામ ઉમેરો.                                                                      | ૦૭   |
| Q.5                                                                                   | (a)     | Explain Lambda Expression in java with example.                                                                                                                                                                                                                                                                                                 | 03   |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૫ | ( અ )   | GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામાં લેlબડા એ4સGLYPH<c=26,font=/QOBAAA+ShrutiRegular>ેશનને ઉદાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                                                                                                                  | ૦૩   |
|                                                                                       | (b)     | What is the use of Deeplearning4j AI Libraries in java.                                                                                                                                                                                                                                                                                         | 04   |
|                                                                                       | ( બ )   | GLYPH<c=1,font=/QOBAAA+ShrutiRegular>વામાં Deeplearning4j AI લાઇrેરGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ઓનો ઉપયોગ b ું છે?                                                                                                                                                                                                                               | ૦૪   |
|                                                                                       | (c)     | Write a Java program to create a new HashSet and add 5 students name in that HashSet.                                                                                                                                                                                                                                                           | 07   |
|                                                                                       | ( ક )   | નવો હGLYPH<c=29,font=/QOBAAA+ShrutiRegular> શ સ ેટ  બ ન ાવવા માટGLYPH<c=29,font=/QOBAAA+ShrutiRegular> GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ા   GLYPH<c=26,font=/QOBAAA+ShrutiRegular> ો, ા મ   લ ખ ો  અ ન ે  ત ે હ GLYPH<c=29,font=/QOBAAA+ShrutiRegular> શ સ ેટમ ા ં   5  િવ j ાથ kઓ ન ા નામ ઉમેરો.                                                            | ૦૭   |
|                                                                                       |         | અથવા OR                                                                                                                                                                                                                                                                                                                                          |      |
| Q.5                                                                                   | (a)     | Explain Stream API in java with example.                                                                                                                                                                                                                                                                                                        | 03   |
| GLYPH<c=1,font=/QZAAAA+BalooBhai2Regular> GLYPH<c=2,font=/QZAAAA+BalooBhai2Regular> ૫ | ( અ )   | GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામાં >0GLYPH<c=19,font=/QOBAAA+ShrutiRegular> મ   API ને ઉદ ાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                                                                                                                | ૦૩   |
|                                                                                       | (b)     | What is the use of TensorFlow Java API AI Libraries in java.                                                                                                                                                                                                                                                                                    | 04   |
|                                                                                       | ( બ )   | GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામાં ટGLYPH<c=29,font=/QOBAAA+ShrutiRegular>(સ રtલ ો GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વ ા   API AI લ ાઇrેરGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ઓ ન ો ઉપ યોગ b ું  છે ?                                                                                                                                         | ૦૪   |
|                                                                                       | (c)     | How to Implement Multiple Inheritance using Interface in java? Explain with example.                                                                                                                                                                                                                                                            | 07   |
|                                                                                       | ( ક )   | GLYPH<c=1,font=/QOBAAA+ShrutiRegular> વામાં ઇ(ટરફGLYPH<c=29,font=/QOBAAA+ShrutiRegular>સ નો ઉપયોગ કરGLYPH<c=19,font=/QOBAAA+ShrutiRegular>ને મ]ટGLYPH<c=19,font=/QOBAAA+ShrutiRegular>પ લ  ઇનહ GLYPH<c=29,font=/QOBAAA+ShrutiRegular> %રટ(સ  કGLYPH<c=29,font=/QOBAAA+ShrutiRegular>વ ી  રGLYPH<c=19,font=/QOBAAA+ShrutiRegular> ત ે  અ મ લ મ ા ં   u ૂકhું? | ૦૭   |
|                                                                                       |         | ઉદાહરણ સાથે સમGLYPH<c=1,font=/QOBAAA+ShrutiRegular> વો.                                                                                                                                                                                                                                                                                             |      |

*****