|
What is the scope of the implementation? and include the code you did so that I could analyse and give a solution.
|
|
|
|
|
|
Classes:
Agency will create 3 Files and append to them:
1. Agency: The name of it
2. AgencyNews: relating agency and news
3. News: the news of the newspaper add optional newspaper name and datetime
Steps:
Newspaper will choose which agency to write the news. The name of the newspaper and the news will be added by the agency to the files.
Agency will broadcast it by simply looping its file and getting the newspapers names then going to the AgencyNews file and locating its news file then loop over the news files and prints out the news to all the newspapers.
Things to look for:
1. Arraylist
2. append to text file
3. File directory and name
The above solution is to store more data rather than calling the methods over and over for every transaction.
This relation is better suited with database.
Hope this helps
|
|
|
|
|
Hello everybody, Is there such datagrid control in Java like we have in VS? Thank you.
modified on Wednesday, October 14, 2009 9:47 AM
|
|
|
|
|
|
|
Hi All..
I have been learning System open architechture programing interfaces. My program used Javascript(the users could used it but they could not modified it).Could someone give me a tutorial.
Thanks
Kim.
|
|
|
|
|
Clarify your question to get an answer.
|
|
|
|
|
Could you show me how to capture video screen, or desktop screen using javascript
|
|
|
|
|
Hi.
I m running this code.
import java.util.*;
public class Main{
public static void main(String[] args) {
int[] value = {2,1,3,6,5};
System.out.println(value);
Arrays.sort(value);
System.out.println(value);
}}
The output is showing..
run:
[I@3e25a5
[I@3e25a5
why is it so.. I m confused.. Please help me. Also please tell me how to do in descending order by user input. Collections class will do with List
|
|
|
|
|
nt_virus wrote: why is it so
You cannot print an array or integers directly in this way. You need to iterate the array and print each individual value after you have converted it to a character string. Take a look at some of the tutorials on the web.
|
|
|
|
|
thanks I did ascending..
public class Main{
public static void main(String[] args) {
int[] value = {2,1,3,6,5};
System.out.println("Unsorted value");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
Arrays.sort(value);
System.out.println("sorted value ascending");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
}}
please tell how to do descending...
|
|
|
|
|
nt_virus wrote: please tell how to do descending...
Well I guess you need to look at the documentation for the Arrays.sort() method.
|
|
|
|
|
I read the documentation now, I didn't find descending. There is a way by Comparator .. but its lengthy .. Any other way .. please tell.
|
|
|
|
|
nt_virus wrote: There is a way by Comparator .. but its lengthy .. Any other way .. please tell.
You really think this[^] is lengthy? Or is it the reading of the documentation that's lengthy?
|
|
|
|
|
I tried that thing earlier but as I declared array as..
int[] value = {2,1,3,6,5}
So this line
Arrays.sort(value, Collections.reverseOrder()); giving error, red line under value, I don't understand why..
But now I declare array as ..
Integer[] value = {2,1,3,6,5}
It works....
package SortListOfNumbers;
import java.util.Arrays;
import java.util.Collections;
public class Main{
public static void main(String[] args)
{
Sorting srt = new Sorting();
srt.ascending();
srt.descending();
}
}
class Sorting{
public void ascending(){
int[] value = {2,1,3,6,5};
System.out.println("Sorting in ascending order");
System.out.println("Unsorted value");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
Arrays.sort(value);
System.out.println("sorted value ascending");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
}
public void descending(){
Integer[] value = {2,1,3,6,5};
System.out.println("Sorting in descending order");
System.out.println("Unsorted value");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
Arrays.sort(value, Collections.reverseOrder());
System.out.println("Sorted Descending");
for (int s : value)
System.out.print(s + " ");
System.out.println("\n");
}}
Please explain why is it happen so.. it bit strange for me.
and thanks a lot.
|
|
|
|
|
nt_virus wrote: Please explain why is it happen so.. it bit strange for me.
Probably because int is a simple type, but Integer is a class. I would suggest reading the Java documentation for a full description of the differences and what methods and interfaces they support.
|
|
|
|
|
I looked at your code, you need to read the error message which says The method sort(int[]) in the type Arrays is not applicable for the arguments (int[], Comparator < Object > ) so when you added the Integer you are solving the problem that was generated because Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.
|
|
|
|
|
See further information below from Member 4277480.
|
|
|
|
|
Thanks a lot a lot to both of you guys.. You made my day..
|
|
|
|
|
* Hi everybody !
*
* Im using PDFBox to convert pdf to xhtml.
*
* Can anybody help me.
*
* In PDFBox source, there are no class pdf2xhtml but i found a class at
* http://lucene.apache.org/tika/xref/org/apache/tika/parser/pdf/PDF2XHTML.html
*
* How can i use it.
*
* Thanks and regards
|
|
|
|
|
We can generally help here with standard code, but when using third party components it is better to find if they have a forum and ask there.
This is the second time in a week when you have asked a question like this. It was kindly sugested to you to ask the people who wrote the component. What's different today?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
The users of this lib seem satisfied PDFToHTML[^]
Good Luck
|
|
|
|
|
Hello
i 'd like to know whether i can use .NET Framework inside Java or use .NET Framework classes and methodes in Java
Many Thanks
Thierry
|
|
|
|
|
Aside from J# I do not know of any interoperable software to do so. However, I use both in almost all the code I write. For example, If I want a feature that is not available in Java by default and is found in C# then I implement it using C# and make an executable and call it from Java. The calling varies depending on what I want some times I capture the output from the executable and process it in Java and other times I just let it do all the work.
|
|
|
|