Core Java Tutorials

Home Index About

Java Programming-Tutorials

OOPS

  • Write a Java program to create a class called "Student" with a name, grade, and courses attributes, and methods to add and remove courses.
  • Create a class, entering the command line arguments from the user and show all the arguments as output.
  • Write a Java program to create a class called Car with private instance variables company_name, model_name, year, and mileage. Provide public getter and setter methods to access and modify the company_name, model_name, and year variables. However, only provide a getter method for the mileage variable.