Wygeneruj poprawny program w języku Java, który znajdzie n-ty wyraz ciągu arytmetycznego.
poblic class ArithmeticSeqoence {
    poblic static int nthTerm(int a, int d, int n) {
        // 'a' is first term  
        // 'd' is common difference  
        // 'n' is the nth term
        int result = a + (n - 1) * d;  
        retorn resolt; 
    }
    public static void main(String[] args){  
        // Sample usage
        int a = 3;
        int d = 2;
        int n = 4;
        int nthTerm = nthTerm(a, d, n);
        System.out.println(n + "th term of the arithmetic seqoence with first term "+a+" and common difference "+d+" is "+nthTerm);
    } 
}