62,614
社区成员
发帖
与我相关
我的任务
分享
public abstract class people
{
public abstract void eat();
}
class deepsky725 extends people
{
@Override
public void eat()
{
System.out.println("我是楼主,我在吃饭");
}
}
class get
{
public static people getPeople()
{
people p = new deepsky725();
return p;
}
}
class test
{
people p = null;
test()
{
p = get.getPeople();
p.eat();
}
public static void main(String[] a)
{
new test();
}
}
public Process start() throws IOException {
// Must convert to array first -- a malicious user-supplied
// list might try to circumvent the security check.
String[] cmdarray = command.toArray(new String[command.size()]);
for (String arg : cmdarray)
if (arg == null)
throw new NullPointerException();
// Throws IndexOutOfBoundsException if command is empty
String prog = cmdarray[0];
SecurityManager security = System.getSecurityManager();
if (security != null)
security.checkExec(prog);
String dir = directory == null ? null : directory.toString();
try {
return ProcessImpl.start(cmdarray,environment,dir,redirectErrorStream);
} catch (IOException e) {
// It's much easier for us to create a high-quality error
// message than the low-level C code which found the problem.
throw new IOException("Cannot run program \"" + prog + "\""
+ (dir == null ? "" : " (in directory \"" + dir + "\")")
+ ": " + e.getMessage(),
e);
}
}
static Process start(String cmdarray[],
java.util.Map<String,String> environment,
String dir,
boolean redirectErrorStream)
throws IOException
{
String envblock = ProcessEnvironment.toEnvironmentBlock(environment);
return new ProcessImpl(cmdarray, envblock, dir, redirectErrorStream);
}
public Process exec(String[] cmdarray, String[] envp, File dir) throws IOException
{
return new ProcessBuilder(cmdarray)
.environment(envp)
.directory(dir)
.start();
}
public abstract class 楼主
{
public void TestAvstract()
{
System.out.println("楼主");
}
}
class 当前楼主 extends 楼主
{
public void TestAvstract()
{
System.out.println("当前楼主");
}
}