0% found this document useful (0 votes)
44 views1 page

OOP - Assignment 1

Static blocks and instance blocks are executed at certain points during program execution. Static blocks are executed when the class is loaded, while instance blocks are executed when an object of the class is created. A program demonstrates the use of static and instance blocks by printing output at different times based on when each block type is executed.

Uploaded by

Should Should
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views1 page

OOP - Assignment 1

Static blocks and instance blocks are executed at certain points during program execution. Static blocks are executed when the class is loaded, while instance blocks are executed when an object of the class is created. A program demonstrates the use of static and instance blocks by printing output at different times based on when each block type is executed.

Uploaded by

Should Should
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Object Oriented Programming

Assignment No.: 1 Assignment Type: Individual

Max Marks: 10 Submission Platform: NUML LMS

th
Submission Deadline: 9 April, 2021 Submission Format: MS Word File

What to do?_______________________________________________________
There are special blocks in JAVA that are executed at certain points in program execution. In this assignment,
you will search and understand these blocks.

Describe the difference between static block and instance (initializer) block. Write the difference in a way that the
concept of both these blocks is clarified. Moreover, also explain when and how many times each of these blocks
gets executed.

Write a program that uses static block and instance (initializer) block.

How to organize the assignment?_____________________________________


Provide a description of Static Block and Instance Initializer Block and their differences as mentioned above.
Include a program that uses these blocks. Try making such a program that clarifies the concept of these blocks.
Include an output screenshot of your program as well.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy