Design a class using object oriented features


  • 0
    C

    Design a class called Url Decoder using the object oriented design features like encapsulation and abstraction etc.
    This class mainly performs two operations:

    1. Returns the domain name.
    2. Gives a hashmap of key-value pairs.

    Note: Focus is not on the logic of the given problem. Focus is on the class design , how to use variables, public private methods , class binding and abstraction.


  • 0
    G

    public class UrlDecoder {
    public String getDomainName() {

    }
    
    public Map<String, String> getMap() {
    
    }
    

    }


  • 0
    C

    @goldbergrvd What about the class variables?
    In getMap() , you would be making hashmap again and again whenevr the function is called?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.