问题 单项选择题

下列程序的执行结果是( )。 public class Test {public static void main(String args[]){ System.out.println(5/2);} }

A.2.5

B.2.0

C.2.50

D.2

答案

参考答案:D

解析: 如果表达式中有不同的数据类型,则寻找自动转换是优先级最高的一个,其他数值全部转换成这种数据类型,当然表达式的值也是这种数据类型。有可能会选择选项A,请注意数据类型之间的关系,结果的数据类型必须和表达式中优先级最高的一个一样。在这里,表达式和结果都是int型。

多项选择题
单项选择题

Phyllis Wheatley is regarded as America’’s first black poet. She was born in Senegal, Africa, about 1753 and brought to America aboard a slave ship at about the age of seven. John and Susannah Wheatley bought her for three pounds at a slave auction in Boston in 1761 to be a personal servant of Mrs. Wheatley. The family had three other slaves, and all were treated with respect. Phyllis was soon accepted as one of the family, which included being raised and educated with the Wheatley’’s twin 15-year-old children, Mary and Nathaniel. At that time, most females, even from better families, could not read and write, but Mary was probably one of the best educated young women in Boston. Mary wanted to become a teacher, and in fact, it was Mary who decided to take charge of Phyllis’’s education. Phyllis soon displayed her remarkable talents. At the age of twelve she was reading the Greek and Latin classics and passages from the Bible. And eventually, Mrs. Wheatley decided Phyllis should become a Christian.At the age of thirteen Phyllis wrote her first poem. She became a Boston sensation after she wrote a poem on the death of the evangelical preacher George Whitfield in 1770. It became common practice in Boston to have "Mrs. Wheatley’’s Phyllis" read poetry in polite society. Mary married in 1771, and Phyllis later moved to the country because of poor health, as a teacher and caretaker to a farmer’’s three children. Mary had tried to interest publishers in Phyllis’’s poems but once they heard she was a Negro they weren’’t interested.Then in 1773 Phyllis went with Nathaniel, who was now a businessman, to London. It was thought that a sea voyage might improve her health. Thirty-nine of her poems were published in London as Poems on Various Subjects, Religious and Moral. It was the first book published by a black American. In 1775 Phyllis wrote a poem extolling the accomplishments of George Washington and sent it to him. He responded by praising her talents and inviting her to visit his headquarters. After both of her benefactors died in 1777, and Mary died in 1778, Phyllis was freed as a slave. She married in 1778, moved away from Boston, and had three children. But after the unhappy marriage, she moved back to Boston, and died in poverty at the age of thirty.

According to the passage, an unusual feature of Mary was that she________.

A.was not much older than Phyllis

B.wanted to become a teacher

C.was comparatively well educated

D.decided to take charge of Phyllis’s education