How to define multiple variables in single statement

前端 未结 6 683
青春惊慌失措
青春惊慌失措 2021-01-18 07:14

In Python, I can define two variables with an array in one line.

>>>[a,b] = [1,2]
>>>a
1
>>>b
2

How do I do the

6条回答
  •  终归单人心
    2021-01-18 07:47

    Maybe

    public class PCT 
    {
        final Point pos;  // two ints!
    
        public PCT (File file) 
        {
            pos = parseFile(file);
        }
    
        public int[] parseFile(File f) 
        {
            Point aa = new Point();
            // ....
            // ....
            return aa;
        }
    }
    

提交回复
热议问题