Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Information systems➝Database management system engines • Computing methodologies➝Massive, Exercises of Human-Computer Interaction Design

Information systems➝Database management system engines • Computing methodologies➝Massively parallel and high-performance simulations. This is just an example, please use the correct category and subject descriptors for your submission. The ACM Computing Classification Scheme: http://www.acm.org/about/class/class/2012. Please read the HOW TO CLASSIFY WORKS USING ACM'S COMPUTING CLASSIFICATION SYSTEM for instructions on how to classify your document using the 2012 ACM Computing Classification Sy

Typology: Exercises

2020/2021

Uploaded on 10/14/2021

jayson-aguilar-1
jayson-aguilar-1 🇵🇭

5

(1)

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Republic of the Philippines
CAMARINES NORTE STATE COLLEGE
F. Pimentel Avenue, Brgy. 2, Daet, Camarines Norte 4600, Philippines
Name:
Manahan, Mariano
Date:
September 18, 2021
Course & Block:
BSIT-2C
Subject:
IT - 102
Exercises:
1. Write a program to demonstrate static variables, methods, and blocks.
public class Demo {
static int x = 10;
static int y;
static void func(int z) {
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);
}
static {
System.out.println("Running static initialization block.");
y = x + 5;
}
public static void main(String args[]) {
func(8);
}
}
Output
Running static initialization block.
x = 10
y = 15
z = 8

Partial preview of the text

Download Information systems➝Database management system engines • Computing methodologies➝Massive and more Exercises Human-Computer Interaction Design in PDF only on Docsity!

Republic of the Philippines

CAMARINES NORTE STATE COLLEGE

F. Pimentel Avenue, Brgy. 2, Daet, Camarines Norte – 4600, Philippines Name: Manahan, Mariano Date: September 18, 2021 Course & Block: BSIT- 2 C Subject: IT - 102 Exercises:

1. Write a program to demonstrate static variables, methods, and blocks. public class Demo { static int x = 10 ; static int y; static void func(int z) { System.out.println("x = " + x); System.out.println("y = " + y); System.out.println("z = " + z); } static { System.out.println("Running static initialization block."); y = x + 5 ; } public static void main(String args[]) { func( 8 ); } }

Output

Running static initialization block. x = 10 y = 15 z = 8