Question
Given the following sequence of Java statements

1. StringBuffer sb = new StringBuffer("abc");
2. String s = new String("abc");
3. sb.append("def");
4. s.append("def");
5. sb.insert(1, "zzz");
6. s.concat(sb);
7. s.trim();
Which of the following statements are true:

A. The compiler would generate an error for line 1.
B. The compiler would generate an error for line 2.
C. The compiler would generate an error for line 3.
D. The compiler would generate an error for line 4.
E. The compiler would generate an error for line 5.
F. The compiler would generate an error for line 6.
G. The compiler would generate an error for line 7.
Select all correct answers.




More Software,Java,Sequence Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q How you can rotate your picture?
  • Q What is an Aphthong?
  • Q Assuming a clustering model's labels are known, how do you evaluate the performance of the model?
  • Q How to make windows look like mac os x?
  • Q How would you eradicate gender inequalities in society?
  • Q Maitree combat excercise b/w?
  • Q What is web forms 2.0 in html5?
  • Q What are the default read and write classes in Hive?
  • Q Which Australian city is nicknamed The Big Smoke?
  • Q What is aortic valve
  • Q Explain what happens to Na+ concentration in the nephron when GFR increases.