在java中写出以下问题的解决方案:在一个2D平面上有一个机器人从位置 (0,0),原始开始.给出它的动作序列,判断它完成后该机器人是否会结束在 (0,0).给出一个符串动作,表示机器人动作序列,其中动作[i]代表其第五动作.有效动作是'R' (右),'L' (左),'U' (上),和'D' (下).如果机器人完成所有动作后返回原始,还要返回true,或者false. 注意:机器人"面向"的方式并不相关.'R'将总是使机器人向右移动,'L'将使机器人向左移动,等等,假设机器人每次移动的运动大小总是相同.
Here's the Java solution to your problem:

```
class Solution {
    public boolean judgeCircle(String moves) {
        int x = 0, y = 0;
        for (char move : moves.toCharArray()) {
            if (move == 'U') y++;
            else if (move == 'D') y--;
            else if (move == 'R') x++;
            else if (move == 'L') x--;
        }
        return x == 0 && y == 0;
    }
}
```

Explanation:

We initialize the robot's position to `(0, 0)` and then iterate through the `moves` string. For each move, we update the position of the robot based on the move. If the move is `U`, we increment the `y` coordinate of the robot's position. If the move is `D`, we decrement the `y` coordinate. If the move is `R`, we increment the `x` coordinate, and if the move is `L`, we decrement the `x` coordinate.

After all the moves are processed, we check if the robot's position is back at the origin `(0, 0)`. If it is, we return `true`, otherwise, we return `false`.