1. Write the output of these code block without running (5) class StaticTest { static int x = 1; int y; StaticTest() {

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Write the output of these code block without running (5) class StaticTest { static int x = 1; int y; StaticTest() {

Post by answerhappygod »

1 Write The Output Of These Code Block Without Running 5 Class Statictest Static Int X 1 Int Y Statictest 1
1 Write The Output Of These Code Block Without Running 5 Class Statictest Static Int X 1 Int Y Statictest 1 (6.72 KiB) Viewed 19 times
1 Write The Output Of These Code Block Without Running 5 Class Statictest Static Int X 1 Int Y Statictest 2
1 Write The Output Of These Code Block Without Running 5 Class Statictest Static Int X 1 Int Y Statictest 2 (28.75 KiB) Viewed 19 times
1. Write the output of these code block without running

(5) class StaticTest { static int x = 1; int y; StaticTest() { y++; } public static void main(String args[]) { StaticTest st = new StaticTest (); System.out.println("x=" + x); System.out.println("st. y=" + st. y); st= new Static Test(); System.out.println("x=" + x); System.out.println("st. y=" + st. y); } static { x++; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply