Is there any need to provide constructor and main() method to develop an Applet and why?

 

Write code for retrieving and printing values/objects of Student class from Array list (collection).

ArrayList<Student> studentList = new ArrayList<Student>();

For printing use method print().

Hint: Use for loop

 

Given is the code of java class Teacher. Your task is to complete this class by writing code for following requirements. Also write access modifiers of each requirement.

  • Data Member: rollNo, name.
  • Setter, Getters for each data member.
  • Display attributes of the object of class Teacher.

 

public class Teacher{

......................................................;

};

 

 

 

Write code that takes input from user in text field from keyboard. When user presses the button “Display”. It displays the input in label on same window.

 

Hint: Use Event Handling

 

Write a method that draws a blue rectangle and a red circle of any size at random locations on the screen having size 1100 * 900.

Views: 17

SPONSORED LINKS

SPONSORED LINKS

© 2020   Created by Irfan Khan MSCS.   Powered by

Badges  |  Report an Issue  |  Terms of Service