-
Given:
https://assets.asklib.com/images/image2/2018080116102651104.jpg
Which code fragment, inserted at line 23, allows the code to compile?()
A . df = new DateFormat();
B . df = Date.getFormat();
C . df = date.getFormat();
D . df = DateFormat.getFormat();
E . df = DateFormat.getInstance()
-
Given:
https://assets.asklib.com/images/image2/2018080111400650032.png
Which two, inserted at line 11, will allow the code to compile?()
A . public&ensp;class&ensp;MinMax<;?>;&ensp;{
B . public&ensp;class&ensp;MinMax<;?extends&ensp;Number>;&ensp;{
C . public&ensp;class&ensp;MinMax<;Nextends&ensp;Object>;&ensp;{
D . public&ensp;class&ensp;MinMax<;Nextends&ensp;Number>;&ensp;{
E . public&ensp;class&ensp;MinMax<;?extends&ensp;Object>;&ensp;{
F . public&ensp;class&ensp;MinMax<;Nextends&ensp;Integer>;&ensp;{
-
Given:
https://assets.asklib.com/images/image2/201808020931223037.jpg
Which two, inserted at line 11, will allow the code to compile?()
A . public class MinMax<?> {
B . public class MinMax<? extends Number> {
C . public class MinMax<N extends Object> {
D . public class MinMax<N extends Number> {
E . public class MinMax<? extends Object> {
F . public class MinMax<N extends Integer> {
-
Given:
https://assets.asklib.com/images/image2/2018080210345322330.jpg
Under which three circumstances will the code on line 37 be executed?()
A . The instance gets garbage collected.
B . The code on line 33 throws an exception.
C . The code on line 35 throws an exception.
D . The code on line 31 throws an exception.
E . The code on line 33 executes successfully.
-
Given:
https://assets.asklib.com/images/image2/2018080110460113518.png
Under which three circumstances will the code on line 37 be executed?()
A . The instance gets garbage collected.
B . The code on line 33 throws an exception.
C . The code on line 35 throws an exception.
D . The code on line 31 throws an exception.
E . The code on line 33 executes successfully.
-
Given:
https://assets.asklib.com/images/image2/2018080114023542163.png
Which two code fragments, inserted independently at line 3, generate the output 4247? ()
A . String s = "123456789";s = (s-"123").replace(1,3,"24") - "89";
B . StringBuffer s = new StringBuffer("123456789");
C . sdelete(0,3).replace(1,3,";24";).delete(4,6);
D . substring(3,6).delete(1,3).insert(1,&ensp;";24";);
-
Given the following code fragment: public void create() { Vector myVect; myVect = new Vector(); } Which of the following statements are true?()
A . The declaration on line 2 does not allocate memory space for the variable myVect.
B . The declaration on line 2 allocates memory space for a reference to a Vector object.
C . The statement on line 2 creates an object of class Vector.
D . The statement on line 3 creates an object of class Vector.
E . The statement on line 3 allocates memory space for an object of class Vector.
-
Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?()
A . FileOutputStream has no constructors matching the given arguments.
B . An IOExeception will be thrown if a file named "data" already exists.
C . An IOExeception will be thrown if a file named "data" does not already exist.
D . If a file named "data" exists, its contents will be reset and overwritten.
E . If a file named "data" exists, output will be appended to its current contents.
-
Given:
https://assets.asklib.com/images/image2/2018080109575355226.png
Which code, inserted at line 14, allows the Sprite class to compile?()
A . Direction d = NORTH;
B . Nav.Direction d = NORTH;
C . Direction d = Direction.NORTH;
D . Nav.Direction d = Nav.Direction.NORTH;
-
Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()
A . String s = c.readLine();
B . char[] c = c.readLine();
C . String s = c.readConsole();
D . char[] c = c.readConsole();
E . String s = c.readLine("%s", "name ");
-
Given:
https://assets.asklib.com/images/image2/2018080113395014348.png
Which code, inserted at line 15, creates an instance of the Point class defined in Line?()
A . Point p = new Point();
B . Line.Point p = new Line.Point();
C . The Point class cannot be instatiated at line 15.
D . Line l = new Line() ; l.Point p = new l.Point();
-
Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()
A . request.getWriter();
B . request.getReader();
C . request.getInputStream();
D . request.getResourceAsStream();
-
Given:
https://assets.asklib.com/images/image2/2018080114103736681.png
Which code fragment, inserted at line 23, allows the code to compile?()
A . df = new DateFormat();
B . df = Date.getFormat();
C . df = date.getFormat();
D . df = DateFormat.getFormat();
E . df = DateFormat.getInstance();
-
Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()
A . String s = c.readLine();
B . char[ ] c = c.readLine();
C . String s = c.readConsole();
D . char[ ] c = c.readConsole();
E . String s = c.readLine("%s", "name ");
F . char[ ] c = c.readLine("%s", "name ");
-
Given:
https://assets.asklib.com/images/image2/2018080115533690970.jpg
Which code, inserted at line 15, allows the class Sprite to compile?()
A . Foo { public int bar() { return 1; }
B . new Foo { public int bar() { return 1; }
C . new Foo() { public int bar() { return 1; }
D . new class Foo { public int bar() { return 1; }
-
Given:
https://assets.asklib.com/images/image2/2018080210462093216.jpg
Which code, inserted at line 14, allows the Sprite class to compile?()
A . Direction d = NORTH;
B . Nav.Direction d = NORTH;
C . Direction d = Direction.NORTH;
D . Nav.Direction d = Nav.Direction.NORTH
-
Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?()
A . Vector filelist = ((Directory) file).getList();
B . String[] filelist = file.directory();
C . Enumeration filelist = file.contents();
D . String[] filelist = file.list();
E . Vector filelist = (new Directory(file)).files();
-
Given that login.getName() returns a java.lang.String value and given the JSP code: Welcome Which is equivalent?()
A . A. Welcome <% out.print(login.getName()); %>
B . Welcome <% writer.print(login.getName()); %>
C . Welcome <% response.out.print(login.getName()); %>
D . Welcome <% response.writer.print(login.getName()); %>
E . Welcome <% response.getOutputStream().write(login.getName()); %>%>
-
Given:
https://assets.asklib.com/images/image2/2018080115312722641.png
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
A . It is true that j==i.
B . It is false that j==i.
C . An exception is thrown at runtime.
D . Compilation fails because of an error in line 13.
-
Given:
https://assets.asklib.com/images/image2/2018080113365623120.png
Which code, inserted at line 15, allows the class Sprite to compile?()
A . Foo { public int bar() { return 1; }
B . new Foo { public int bar() { return 1; }
C . new Foo() { public int bar() { return 1; }
D . new class Foo { public int bar() { return 1; }
-
Given:
https://assets.asklib.com/images/image2/201808021105099212.jpg
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
A . It is true that j==i.
B . It is false that j==i.
C . An exception is thrown at runtime.
D . Compilation fails because of an error in line 13.
-
Given: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14.//insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()
A . b = nf.parse( input );
B . b = nf.format( input );
C . b = nf.equals( input );
D . b = nf.parseObject( input );
-
Given:
https://assets.asklib.com/images/image2/2018080116332893969.png
Which code fragment, inserted at the end of line 12, produces the output 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);
-
Given:What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
<img src='https://img2.soutiyun.com/ask/uploadfile/2019-03-27/047d6bd4894fe3060c1d5c6a923e9029.jpg' />
A. It is true that j==i.
B. It is false that j==i.
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 13.