annedi
annedi

Reputation: 11

util.Random symbol not found

I was working with web services and when i compile my util.Random was not found by the compiler why? This is my code fragment

import javax.jws.WebService;
import javax.jws.WebMethod;
import java.util.Random.*;

// annotation; a j2se 5 feature
@WebService
public class Card {
    Random r = new Random();

    @WebMethod

    public int getCard(){

        int random = new r.nextInt(10) + 1;
        return random;
    }
}

Upvotes: 0

Views: 374

Answers (1)

Jesper
Jesper

Reputation: 206896

Change this:

import java.util.Random.*;

to this:

import java.util.Random;

Upvotes: 3

Related Questions