Which statements about Java code security are true?()
AThe bytecode verifier loads all classes needed for the execution of a program.
BExecuting code is performed by the runtime interpreter.
CAt runtime the bytecodes are loaded, checked and run in an interpreter.
DThe class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.
相关问题推荐
-
What are four valid examples of polymorphic method calls?()
Ax.a2();
Bz.a2();
Cz.c1();
Dz.a1();
Ey.c1();
Fx.a1();
-
//point X public class foo ( public static void main (Stringargs) throws Exception { printWriter out = new PrintWriter (new ) java.io.outputStreamWriter (System.out), true; out.printIn(“Hello”); } ) Which statement at PointX on line 1 allows this code to compile and run?()
A、 Import java.io.PrintWriter;
B、 Include java.io.PrintWriter;
C、 Import java.io.OutputStreamWriter;
D、 Include java.io.OutputStreamWriter;
E、 No statement is needed.
-
What is the result?()
A、 Compilation of class A fails.
B、 Line 28 prints the value 3 to System.out.
C、 Line 28 prints the value 1 to System.out.
D、 A runtime error occurs when line 25 executes.
E、 Compilation fails because of an error on line 28.
-
11. class Payload { 12. private int weight; 13. public Payload(int wt) { weight = wt; } 13. public void setWeight(mt w) { weight = w; } 15. public String toString { return Integer.toString(weight); } 16. } 17. 18. public class TestPayload { 19. static void changePayload(Payload p) { 20. /* insert code here */ 21. } 22. 23. public static void main(String[] args) { 24. Payload p = new Payload(); 25. p.setWeight(1024); 26. changePayload(p); 27. System.out.println(”The value of p is “+ p); 28. } 29. } Which statement, placed at line 20, causes the code to print “The value of p is 420.”?()
A、 p.setWeight(420);
B、 p.changePayload(420);
C、 p = new Payload(420);
D、 Payload.setWeight(420);
E、 p = Payload.setWeight(420);
F、 p = new Payload(); p.setWeight(420);
-
public class Test { public static void main(String [] args) { boolean assert = true; if(assert) { System.out.println(”assert is true”); } } } Given: javac -source 1.3 Test.java What is the result?()
A、 Compilation fails.
B、 Compilation succeeds with errors.
C、 Compilation succeeds with warnings.
D、 Compilation succeeds without warnings or errors.