More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. public class BuggyBread {
public static void main(String args[]) {
String str = "we are what we repeatedly Do excellence, then, is not an act but a haBit";
Set<String> words = new HashSet();
for(String word:str.split(" ")){
if(words.contains(word)){
System.out.println(word);
} else {
words.add(word);
}
}
}
}
Help us improve. Please let us know the company, where you were asked this question :
Ans. public class BuggyBread {
public static void main(String args[]) {
String str1 = "we are what we repeatedly Do excellence, then, is not an act but a haBit";
String str2 = "we are what we repeatedly Do is";
String[] str1Words = str1.split(" ");
String[] str2Words = str2.split(" ");
Ans. public class BuggyBread {
public static void main(String args[]) {
String str1 = "we are what we repeatedly Do excellence, then, is not an act but a haBit";
String str2 = "we are what we repeatedly Do is";
String[] str1Words = str1.split(" ");
String[] str2Words = str2.split(" ");
Ans.
public class BuggyBread {
public static void main(String args[]) {
String str = "we are what we repeatedly Do excellence, then, is not an act but a haBit";
Set<String> wordSet = new LinkedHashSet(); // Using Linked Hash Set as we would like to retrieve words in the insertion order
Ans. public class BuggyBread {
public static void main(String args[]) {
String str = "we are what we repeatedly do excellence then is not an act but a haBit";
Set<String> wordSet = new TreeSet(); // Using Linked Hash Set as we would like to retrieve words in the insertion order
Ans. HashTable locks the complete collection to provide synchronization whereas ConcurrentHashMap only locks segments to achieve synchronization and hence better efficient and faster.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes, they both aim at providing synchronized access to the Map collection. The only difference is in their implementation. ConcurrentHashMap came after HashTable and hence technically more efficient as it doesn't lock the complete map while accessing it.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Both are creational design patterns but singleton facilitates in creation and reuse of single object whereas Factory deals with creation of multiple objects.
Help us improve. Please let us know the company, where you were asked this question :
Ans. By specifying XSiteScriptingProtection within wc-server.xml. Prohibited characters and attributes are specified within XSiteScriptingProtection to protect the application from any XSS attach.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Asset stores are collections of sharable resources (business artifacts, business processes and storefront assets) that can be leveraged in other stores.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Attribute dictionary is a set of common attributes that can be reused by multiple products.
The attribute dictionary provides a central place to manage shared attributes, with the following features:
The ability to standardize attributes.
The ability to easily compare attributes shared by products and SKUs.
The ability to quickly change attributes in one place to affect all catalog entries.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Part of the order that needs to be shipped to a particular Address. There could be an Order where different portions needs to be delivered to different addresses. Each portion in such case is a suborder.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The Marketing subsystem is a component of the WebSphere Commerce Server, and provides numerous marketing concepts to your site, designed to increase brand awareness, and to attract and retain customers. Components of the marketing subsystem provide functionality to create marketing campaigns, including customer segments and advertising; and e-mail activities.
Various components are -
1. Promotions
2. Auctions
3. eSpots
4. e Mail Campaigns
5. Hubs and Extended sites for affiliates
Help us improve. Please let us know the company, where you were asked this question :