'F' → Fullscreen
Add a static counter to the Student
class to track how many objects have been created.
class Student { private String name; private static int studentCount = 0;
public Student(String name) { this.name = name; studentCount++; }
public String getName() { return name; }
public static int getStudentCount() { return studentCount; }}public class Main { public static void main(String[] args) { Student s1 = new Student("Alex"); Student s2 = new Student("Jordan"); Student s3 = new Student("Riley");
System.out.println("Total students: " + Student.getStudentCount()); }}Run the program. Notice how static variables track data shared across all objects.
Write a utility class with static methods that convert temperatures.
class TemperatureConverter { public static double cToF(double c) { return (c * 9.0 / 5.0) + 32; }
public static double fToC(double f) { return (f - 32) * (5.0 / 9.0); }}public class Main { public static void main(String[] args) { System.out.println("20C in F: " + TemperatureConverter.cToF(20)); System.out.println("72F in C: " + TemperatureConverter.fToC(72)); }}Total students: 3
20C in F: 68.072F in C: 22.222...main method static?
Submit your completed project and reflection answers to the appropriate dropbox.