Software Engineering exp9
Software Engineering exp9
UML diagram
// Derived Class
public class Student extends Person {
private int rollNo;
public Student(String name, int age, int rollNo) {
super(name, age);
this.rollNo = rollNo;
}
@Override
public void displayInfo() {
super.displayInfo();
System.out.println("Roll No: " + rollNo);
}
}
// Main Program
public class Main {
public static void main(String[] args) {
Student s = new Student("Alice", 20, 101);
s.displayInfo();
}
}
Conclusion
Forward engineering ensures systematic, traceable, and model-
driven development. Translating UML diagrams to Java code
supports clarity, maintainability, and real-world object mapping.