Before me is the task: to write a class "Students" in which they will choose their elder. But for starters, I would like to give students the names that I shoved into an array. There will be 10 students (objects) in a class (((or it’s better to create 1 object. This has not yet been decided)) with 3 qualities each ("znanie", "trydolubie", "ysidchivoct"). These will be variables that will take a value from 0 to 10. Here is what I have at the moment:
public class Students { String Starosta; String [] name={"Петя","Витя","Маша","Гриша","Света","Коля","Никита","Вика","Артур","Валера","Дима"}; public void getName(){ } public static void main(String[] args) { Students student1= new Students(); Students student2= new Students(); Students student3= new Students(); Students student4= new Students(); Students student5= new Students(); Students student6= new Students(); Students student7= new Students(); Students student8= new Students(); Students student9= new Students(); Students student10= new Students(); student1.getName(); System.out.println(student1.nextInt(10)); Since I am a green Padawan and Uncle Google does not give answers, I decided to turn to the sages for guidance. Here are the questions I have:
How to make so that from this array randomly chosen name and assigned to the student?
Is it possible for a student (who already has a name) to assign random qualities?