Java Easy Intuitive Solution-->
\nclass Solution {\n    public long smallestNumber(long num) {\n        if(num > 0){\n            String s = String.valueOf(num);\n            char c[] = s.toCh
```\nclass Solution {\n    public long smallestNumber(long num) {\n        if(num > 0){\n            String s = String.valueOf(num);\n            char c[] = s.toCharArray();\n            Arrays.sort(c);\n            int i = 0;\n            while(c[i] == \'0\')\n                i++;\n            char temp = c[0];\n            c[0] = c[i];\n            c[i] = temp;\n            StringBuilder sb = new StringBuilder();\n            for(char c1 : c){\n                sb.append(c1);\n            }\n            return Long.parseLong(sb.toString());\n        } \n        else{\n            String s = String.valueOf(num);\n            s = s.replace("-", "");\n            char c[] = s.toCharArray();\n            Arrays.sort(c);\n            \n            StringBuilder sb = new StringBuilder();\n            for(char c1 : c){\n                sb.append(c1);\n            }\n            return (-1)*Long.parseLong(sb.reverse().toString());\n        }\n    }\n}\n```
['String', 'Sorting', 'Java']