How can i print a variable in parenthesis.
i have a
string variable gpa
passed it into a constructor
created a getter and setter for the gpa and a to string , now i have an object which is initialized... i think its easier to explain if i post my code.
in main i have
private static ArrayList<Student> students = new ArrayList<>();
students.add(new Student("CS",3.4));
now when i output the student object i get the expected output CS 3.4
but i want to have the literal string "CS" printed inside a parenthesis (CS) i will be adding more students to my array list and thought it might be cool if i dont have to worry about formatting the literal string
like this every time "(CS)"