The purpose of this discussion is to explore concurrency, which refers to threads that run alongside each other during program execution, as opposed to running serially, or one after the other, and to discuss potential drawbacks and problems associated with concurrency.
Benefits and Drawbacks of Concurrency
The purpose of this discussion is to explore concurrency, which refers to threads that run alongside each other during program execution, as opposed to running serially, or one after the other, and to discuss potential drawbacks and problems associated with concurrency.
Java™ provides built-in support for concurrent programming by allowing the running of multiple threads concurrently within a single program. A thread, also called a lightweight process, is a single sequential flow of programming operations with a definite beginning and end. During the lifetime of a thread, there is only a single point of execution. A thread by itself is not a program, because it cannot run on its own, instead all threads must run within a program.
Research and discuss with your classmates the benefits of concurrency in Java™. What are the potential drawbacks?
DQ2 Localization
The purpose of this activity is to provide you with an explanation for, and some experimentation with, the concept of localization via the Locale object.
Localization is the process of adapting a program so that it displays information in the way local users need to see it, and is important for any program running on the web where users from virtually any country in the world can access it.
A program that has been effectively localized displays currency in pounds and dates in day/month/year format to United Kingdom audiences, currency in dollars and dates in month/day/year format to United States audiences, etc.
Localization is particularly significant in that it allows for organizing all user-facing text so that it display text in different languages, as necessary.
Note: This course does not address localization in detail, however it does introduce the topic and demonstrate how setting a Locale object allows Java™ programmers to take advantage of pre-built formatting.
For this supporting activity, you will run an existing Java™ program to see how changing the Locale object automatically changes date formats.
Download the linked Java™ file, or cut-and-paste it into a new Java™ project in NetBeans using a name of your choosing.
Examine the Java™ code, paying special attention to the main() method, in which three Locale objects are created: one for France, one for Germany, and one for the United States. Notice that passing different Locale objects to the same methods (e.g., showDateStyles(), showTimeStyles(), and showBothStyles()) results in a customized display.
Note: Refer to the linked list of standardized codes to see which codes represent which countries.
Insert the following code at the beginning of the main() method, just after the opening curly brace:
Date now = new Date();
System.out.println(“Here is default date format: ” +
DateFormat.getInstance().format(now));
Save the program, and run it in NetBeans again. What locale does the Java™ runtime environment assume by default: U.S. or European? (Hint: Typically, the Java™ runtime environment sets the default locale on download/install based on your computer system.)
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
