单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()A The charAt() method of the String class.B The toUpperCase() method of the String class.C The replace() method of the String class.D The reverse() meth

题目
单选题
Which methods from the String and StringBuffer classes modify the object on which they are called?()
A

The charAt() method of the String class.

B

The toUpperCase() method of the String class.

C

The replace() method of the String class.

D

The reverse() method of the StringBuffer class.

E

The length() method of the StringBuffer class.

参考答案和解析
正确答案: A
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. You implement the delete method as follows:void DeleteItems(string id);You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?()

A. Add the WebInvoke(UriTemplate="/Items/{id}", Method="DELETE") attribute to the operation

B. Add the HttpDelete atribute to the operation

C. Replace the string parameter with a RemovedActivityAction parameter

D. Replace the return type with RemovedActivityAction.


参考答案:A

第2题:

public class CreditCard {  private String cardlD;  private Integer limit;  public String ownerName;  public void setCardlnformation(String cardlD,  String ownerName, 28. Integer limit) {  this.cardlD = cardlD;  this.ownerName = ownerName;  this.limit = limit;  }  } Which is true?() 

  • A、 The class is fully encapsulated.
  • B、 The code demonstrates polymorphism.
  • C、 The ownerName variable breaks encapsulation.
  • D、 The cardlD and limit variables break polymorphism.
  • E、 The setCardlnformation method breaks encapsulation.

正确答案:C

第3题:

以下代码有问题,下列说法正确的是()。代码如下:public A{public void method(){} (1)public string method(){} (2)public string method(int a){} (3)}

A、(1)和(2)删掉一个,错误解决

B、(3)删掉,错误解决

C、没问题


正确答案:A

第4题:

A programmer needs to create a logging method that can accept an arbitrary number of arguments. For example, it may be called in these ways:  logIt(”log message 1 “);  logIt(”log message2”,”log message3”);  logIt(”log message4”, “log message5”, “log message6);  Which declaration satisfies this requirement?()

  • A、 public void logIt(String * msgs)
  • B、 public void logIt(String [] msgs)
  • C、 public void logIt(String... msgs)
  • D、 public void logIt(String msg1, String msg2, String msg3)

正确答案:C

第5题:

You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner.You need to add a delete operation. You implement the delete method as follows. string void DeleteItems(string id);You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?()

  • A、 Add the WebInvoke(UriTemplate = "/Items/{id}",Method="DELETE") attribute to the operation.
  • B、 Add the HttpDelete attribute to the operation.
  • C、 Replace the string parameter with a RemovedActivityAction parameter.
  • D、 Replace the return type with RemovedActivityAction.

正确答案:A

第6题:

A method returning length of the String.


正确答案:
 

第7题:

public String makinStrings() {  String s = “Fred”;  s = s + “47”;  s = s.substring(2, 5);  s = s.toUpperCase();  return s.toString();  }  How many String objects will be created when this method is invoked?() 

  • A、 1
  • B、 2
  • C、 3
  • D、 4
  • E、 5
  • F、 6

正确答案:C

第8题:

You are writing a method that accepts a string parameter named message.Your method must break the message parameter into individual lines of text and pass each line to a second method named Process.Which code segment should you use?()

A.

B.

C.

D.


参考答案:D

第9题:

Which statements concerning the methods notify() and notifyAll() are true?  

  • A、Instances of class Thread have a method called notify().
  • B、A call to the method notify() will wake the thread that currently owns the monitor of the object.
  • C、The method notify() is synchronized.
  • D、The method notifyAll() is defined in class Thread.
  • E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

正确答案:A,E

第10题:

Under which circumstances will a thread stop?()  

  • A、The method waitforId() in class MediaTracker is called.
  • B、The run() method that the thread is executing ends.
  • C、The call to the start() method of the Thread object returns.
  • D、The suspend() method is called on the Thread object.
  • E、The wait() method is called on the Thread object.

正确答案:B

更多相关问题