Question: The Java program below has some errors: package activity1; public class Activity1 { String name; int rollno; int age; public static void main(String[] arg) {

The Java program below has some errors:

package activity1;

public class Activity1 {

String name;

int rollno;

int age;

public static void main(String[] arg) {

activity1 std = new activity1();

// Accessing the property value

student.name = "Ramesh";

student.number = 253110101;

student.age = 25;

System.out.println("Name: "+ student.name);

System.out.println("Student Number: "+ student.number);

System.out.println("Age: "+ student.age);

}

}

Correct and run the program using InteliJ or Netbeans Java and Add Department as part of the output and Add Semester mark as part of the output .

Sample run:

Name: Ramesh

Student Number: 253110101

Age: 25

Department: Computer Science

Semester Mark: 67

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!