Question
Given the following declarations
String s1=new String("Hello")
String s2=new String("there");
String s3=new String();
Which of the following are legal operations?
1) s3=s1 + s2;
2) s3=s1-s2;
3) s3=s1 & s2
4) s3=s1 && s2

Answers

1) s3=s1 + s2;
Java does not allow operator overloading as in C++, but for the sake of convenience the + operator is overridden for strings.   Your Comment




More Software,Java 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 Can you split deliveries into several invoices? when would you do that?
  • Q I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
  • Q You have data warehousing as a subject. Where is it used?
  • Q In India, how many times has the president declared financial emergency-
  • Q Minority Groups are recognized on the basis of their
  • Q Explain what is meant by port blocking within lan?
  • Q Indravati National Park is located in
  • Q In 1993, National Human Rights Commission is established under the ______:
  • Q How to do customization of rebate processing in the SD module?
  • Q Expand BOSLA
  • Q What will happen if we will use floats across the page with 100% width?