In App购买的所有教程都使用SKPayments类的弃用方法"paymentWithProductIdentifier".有什么替代品吗?
这可能确实是一个非常简单的问题,但我对Java完全不熟悉,也没有得到如何解决它.
我有一个stdlib.jar文件,其中有一些类定义为StdRandom,我必须在我的程序中使用它们.我读过,要使用像stdlib.jar这样的文件我必须使用默认包.所以我从下面的程序中删除了"package algs4".但它没有用.
package algs4;
public class PercolationStats
{
//Some method declarations
public static void main(String[] args)
{
//Some code
for(int counter=0; counter<T; counter++)
{
while(!p.percolates())
{
iIndex = StdRandom.uniform(N);
jIndex = StdRandom.uniform(N);
...
}
}
}
Run Code Online (Sandbox Code Playgroud)
每次我编译这个程序使用:
javac -cp . algs4/PercolationStats.java
Run Code Online (Sandbox Code Playgroud)
我收到错误:
algs4/PercolationStats.java:30: cannot find symbol
symbol : variable StdRandom
location: class algs4.PercolationStats
iIndex = StdRandom.uniform(N);
Run Code Online (Sandbox Code Playgroud)
我也尝试使用以下方法编译:
javac -cp .:stdlib.jar algs4/PercolationStats.java
Run Code Online (Sandbox Code Playgroud)
但错误仍然相同.
虽然这不是一个好习惯,但我也从.jar文件中提取了文件,它给了我StdRandom.java文件,但它仍然不起作用.
包括stdlib.jar在内的所有文件都在同一目录中.
我该怎么办呢?
编辑:只是为了使任何未来的引用更详细的问题:程序中使用的stdlib.jar是在"默认"包中.