Q2. Write two Java classes: Student and Main as follow: Class Student: A. Create three private variables: Name, ID and Specialization. B. Define set and get methods for the variable Name. C. Override the toString method to display the class instances. Class Main: A. Define the main method B. Define an array of the class Student with a size of 10. C. Use the loop for data entry in each object. D. Print all objects values.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question
QUESTION 1
Q2. Write two Java classes: Student and Main as follow:
Class Student:
A. Create three private variables: Name, ID and Specialization.
B. Define set and get methods for the variable Name.
C. Override the toString method to display the class instances.
Class Main:
A. Define the main method
B. Define an array of the class Student with a size of 10.
C. Use the loop for data entry in each object.
D. Print all objects values.
Transcribed Image Text:QUESTION 1 Q2. Write two Java classes: Student and Main as follow: Class Student: A. Create three private variables: Name, ID and Specialization. B. Define set and get methods for the variable Name. C. Override the toString method to display the class instances. Class Main: A. Define the main method B. Define an array of the class Student with a size of 10. C. Use the loop for data entry in each object. D. Print all objects values.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Development strategies
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage