-
Which two methods, inserted independently at line 17, correctly complete the Sales class?()https://assets.asklib.com/images/image2/2018080113342240957.jpg
A . double getSalesAmount() { return 1230.45; }
B . public double getSalesAmount() { return 1230.45; }
C . private double getSalesAmount() { return 1230.45; }
D . protected double getSalesAmount() { return 1230.45; }
-
Given: 10. class One { 11. void foo() { } 12. } 13. class Two extends One { 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two?()
A . public void foo() { /* more code here */ }
B . private void foo() { /* more code here */ }
C . protected void foo() { /* more code here */ }
D . int foo() { /* more code here */ }
E . void foo() { /* more code here */ }
-
public class OuterClass { private double d1 1.0; //insert code here } You need to insert an inner class declaration at line2. Which two inner class declarations are valid?()
A . static class InnerOne { public double methoda() {return d1;} }
B . static class InnerOne { static double methoda() {return d1;} }
C . private class InnerOne { public double methoda() {return d1;} }
D . protected class InnerOne { static double methoda() {return d1;} }
E . public abstract class InnerOne { public abstract double methoda(); }
-
Given:
https://assets.asklib.com/images/image2/2018080210080511517.jpg
https://assets.asklib.com/images/image2/2018080210075661615.jpg
Which two code fragments, inserted independently at line 13, will compile?()
A . super(name, baseSalary);
B . this.commission = commission;
C . super();this.commission = commission;
D . this.commission = commission;super();
E . super(name, baseSalary);this.commission = commission;
F . this.commission = commission;super(name, baseSalary);
G . super(name, baseSalary, commission)
-
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/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:
https://assets.asklib.com/images/image2/2018080111582742271.png
Which three methods, inserted individually at line 14, will correctly complete class Two?()
A . int foo() { /* more code here */ }
B . void foo() { /* more code here */ }
C . public void foo() { /* more code here */ }
D . private void foo() { /* more code here */ }
E . protected void foo() { /* more code here */ }
-
1. public class OuterClass { 2. private double d1 = 1.0; 3. // insert code here 4. } Which two are valid if inserted at line 3?()
A . static class InnerOne { public double methoda() { return d1; } }
B . static class InnerOne { static double methoda() { return d1; } }
C . private class InnerOne { public double methoda() { return d1; } }
D . protected class InnerOne { static double methoda() { return d1; } }
E . public abstract class InnerOne { public abstract double methoda(); }
-
Which two code fragments, inserted independently at line 3, generate the output 4247?()https://assets.asklib.com/images/image2/2018080115362240155.jpg
A . String s = "123456789"; s = (s - "123").replace(1, 3, "24") - "89";
B . StringBuffer s = new StringBuffer("123456789");s.delete(0, 3).replace(1, 3, "24").delete(4, 6);
C . StringBuffer s = new StringBuffer("123456789"); s.substring(3, 6).delete(1,3).insert(1, "24");
D . StringBuilder s = new StringBuilder("123456789");s.substring(3, 6).delete(1, 2).insert(1, "24");
E . StringBuilder s = new StringBuilder("123456789"); s.delete(0, 3).delete(1, 3).delete(2, 5).insert(1, "24");
-
Given:
https://assets.asklib.com/images/image2/2018080210520884521.jpg
Which three methods, inserted individually at line 14, will correctly complete class Two?()
A . int foo() { /* more code here */ }
B . void foo() { /* more code here */ }
C . public void foo() { /* more code here */ }
D . private void foo() { /* more code here */ }
E . protected void foo() { /* more code here */ }
-
10.publicclassBar{ 11.staticvoidfoo(int...x){ 12.//insertcodehere 13.} 14.} Which two code fragments,inserted independently at line1 2,will allow the class to compile()
A . foreach(x)System.out.println(z);
B . for(intz:x)System.out.println(z);
C . while(x.hasNext())System.out.println(x.next());
D . for(inti=0;i
-
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
A . int foo() { /* more code here */ }
B . void foo() { /* more code here */ }
C . public void foo() { /* more code here */ }
D . private void foo() { /* more code here */ }
E . protected void foo() { /* more code here */ }
-
10. public class Bar { 11.static void foo(int...x) { 12. // insert code here 13. } 14. } Which two code fragments, inserted independently at line 12, will allow the class to compile?()
A . foreach(x) System.out.println(z);
B . for(int z : x) System.out.println(z);
C . while( x.hasNext()) System.out.println( x.next());
D . for( int i=0; i< x.length; i++ ) System.out.println(x[i]);
-
Which two code fragments, inserted independently at line 12, will compile?()https://assets.asklib.com/images/image2/2018080111245793093.jpg
A . super(name, baseSalary);
B . this.commission=commission;
C . super();this.commission=commission;
D . this.commission = commission;super();
E . super(name, baseSalary);this.commission=commission;
F . this.commission=commission;super(name, baseSalary);
G . super(name, baseSalary, commission);
-
14. DateFormat df; 15. Date date = new Date(); 16. //insert code here 17. String s = df.format( date); Which two,inserted independently at line 16, allow the code to compile?()
A . df= new DateFormat();
B . df= Date.getFormatter();
C . df= date.getFormatter();
D . df= date.getDateFormatter();
E . df = DateFormat.getDateInstance();
F . df= DateFormat.getInstance();
-
class One { public One foo() { return this; } } class Two extends One { public One foo() { return this; } } class Three extends Two { // insert method here } Which two methods, inserted individually, correctly complete the Three class?()
A . public void foo() { }
B . public int foo() { return 3; }
C . public Two foo() { return this; }
D . public One foo() { return this; }
E . public Object foo() { return this; }
-
public class OuterClass { private double d1 1.0; //insert code here } You need to insert an inner class declaration at line2. Which two inner class declarations are valid?()
A . static class InnerOne { public double methoda() {return d1;} }
B . static class InnerOne { static double methoda() {return d1;} }
C . private class InnerOne { public double methoda() {return d1;} }
D . protected class InnerOne { static double methoda() {return d1;} }
E . public abstract class InnerOne { public abstract double methoda(); }
-
public class TestString3 { public static void main(String[] args) { // insert code here System.out.println(s); } } 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”); s.delete(0,3).replace( 1,3, “24”).delete(4,6);
C . StringBuffer s = new StringBuffer(”123456789”); s.substring(3,6).delete( 1 ,3).insert(1, “24”);
D . StringBuilder s = new StringBuilder(”123456789”); s.substring(3,6).delete( 1 ,2).insert( 1, “24”);
E . StringBuilder s = new StringBuilder(”123456789”); s.delete(0,3).delete( 1 ,3).delete(2,5).insert( 1, “24”);
-
Given:
https://assets.asklib.com/images/image2/201808020923131133.jpg
Which two methods, inserted independently at line 17, correctly complete the Sales class?()
A . double getSalesAmount() { return 1230.45; }
B . public double getSalesAmount() { return 1230.45; }
C . private double getSalesAmount() { return 1230.45; }
D . protected double getSalesAmount() { return 1230.45; }
-
Given:
https://assets.asklib.com/images/image2/2018080111591755560.png
Which two methods, inserted independently at line 17, correctly complete the Sales class?()
A . double getSalesAmount() { return 1230.45; }
B . public double getSalesAmount() { return 1230.45; }
C . private double getSalesAmount() { return 1230.45; }
D . protected double getSalesAmount() { return 1230.45; }
-
Given:
https://assets.asklib.com/images/image2/2018080116063010254.png
Which two code fragments, inserted independently at line 5, will compile without warnings?()
A . public void addStrings(List list) {
B . public void addStrings(List<String> list) {
C . public void addStrings(List<? super String> list) {
D . public void addStrings(List<? extends String> list) { B,C
-
publicclassBar{11.staticvoidfoo(int...x){12.//insertcodehere13.}14.}Which two code fragments,inserted independently at line1 2,will allow the class to compile()
A.foreach(x)System.out.println(z);
B.for(intz:x)System.out.println(z);
C.while(x.hasNext())System.out.println(x.next());
D.for(inti=0;i<x.length;i++)system.out.println(x[i]);< body=""></x.length;i++)system.out.println(x[i]);<>
-
Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()
<img src='https://img2.soutiyun.com/shangxueba/ask/64326001-64329000/64326530/4cf8417195a93b758bf9191835b42d8f.jpg' />
A.Point p = Line.getPoint();
B.Line.Point p = Line.getPoint();
C.Point p = (new Line()).getPoint();
D.Line.Point p = (new Line()).getPoint();