How can i get user input from the console?
Here is my code so far if it helps:I want to get 'StudentName' from the console.Code:public class Student { private static String Teacher; private static String StudentName; /** * Create a student * * @param StudentName */ public Student() { //Do nothing! } public static void main(String StudentName) { Student student = new Student(); Teacher = "Mr Whyley"; StudentName = StudentName; //Print details System.out.println("Student Name: " + StudentName); System.out.println("Teacher: " + Teacher); } /** * Get teacher name for a student * * @return Teacher */ public String getTeacher() { return Teacher; } }




Reply With Quote