SINGLE LINE  JAVA SOLUTION -TWO APPROACHES
APPROACH 1\n\nclass Solution {\n    public String convertToBase7(int num) {\n     return Integer.toString(num, 7);   \n    }\n}\n\nAPPROACH 2\n# Code\njava []\n
APPROACH 1\n```\nclass Solution {\n    public String convertToBase7(int num) {\n     return Integer.toString(num, 7);   \n    }\n}\n```\nAPPROACH 2\n# Code\n```java []\nclass Solution {\n    public String convertToBase7(int num) {\n        if(num<0) return "-"+convertToBase7(-num);\n        if(num<7) return Integer.toString(num);\n        return convertToBase7(num/7)+Integer.toString(num%7);\n    }\n}\n```
['Math', 'Java']