From 4b01248b29caf729d3d256c64f318c0aa6fcc331 Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Tue, 19 Sep 2023 20:39:42 +0100 Subject: [PATCH] (refactor) Move constructor to top of class --- week1.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/week1.java b/week1.java index 5fa1b63..7544330 100644 --- a/week1.java +++ b/week1.java @@ -33,6 +33,15 @@ class Section { class Lab { + public Lab(int lN) { + String title = String.format("|Starting Lab %s|", lN); + this._labNumber = lN; + + System.out.println("*".repeat(title.length())); + System.out.println(title); + System.out.println("*".repeat(title.length())); + } + private int _labNumber; public Section currentSection; @@ -52,15 +61,6 @@ class Lab { System.out.println("-".repeat(title.length())); } - public Lab(int lN) { - String title = String.format("|Starting Lab %s|", lN); - this._labNumber = lN; - - System.out.println("*".repeat(title.length())); - System.out.println(title); - System.out.println("*".repeat(title.length())); - } - public int getLabNumber() { return this._labNumber; }