[BAEL-6859] inner sub classes (#14631)

* [BAEL-6859] inner and sub classes

* [BAEL-6859] unit test cases added

* [BAEL-6859] usage of inner class in outer class

* [BAEL-6859] usage of inner class in outer class

---------

Co-authored-by: Bhaskar <bhaskar.dastidar@freshworks.com>
This commit is contained in:
Bhaskar Ghosh Dastidar 2023-08-21 20:50:48 +05:30 committed by GitHub
parent c62680becb
commit de6d040193
1 changed files with 8 additions and 3 deletions

View File

@ -1,11 +1,12 @@
package com.baeldung.subclassinnerclass;
import java.util.HashMap;
public class EmailNotifier extends Notifier {
@Override
void notify(Message e) {
// Provide email specific implementation here
// connect to the email connector
EmailConnector emailConnector = new EmailConnector();
emailConnector.connect();
// send email
}
// Inner class for email connection
@ -13,5 +14,9 @@ public class EmailNotifier extends Notifier {
private String emailHost;
private int emailPort;
// Getter Setters
private void connect() {
// connect to the smtp server
}
}
}