Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part II: Show the printout of the following code: (10pts) public class Test ( public static void main(String[] args) { Student st1= new Student

 

Part II: Show the printout of the following code: (10pts) public class Test ( public static void main(String[] args) { Student st1= new Student ("John Smith"); Student st2 = new Student ("Mary kyle"); System.out.println ("the first student's name is " + stl.name); System.out.println ("the second student's name is " + st2.name); System.out.println ("totalEnroll of stl is " + stl.totalEnroll); System.out.println("totalEnroll of st2 is " + st2.totalEnroll); System.out.println("the total enrollment is " + Student.totalEnroll); class Student { static int totalEnroll = 0; String name; Student (String s) { totalEnroll++; name=S;

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

The provided code has some syntax errors Heres the corrected version public class Test public static ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Java Programming And Data Structures Comprehensive Version

Authors: Y. Daniel Liang

12th Edition

0136520235, 978-0136520238

More Books

Students also viewed these Programming questions