|
yeah same i was doing in my code can you please take a look of it
|
|
|
|
|
As I suggested earlier, it can be simplified considerably by using the Scanner class, as in the following sample. If you do not wish to use the scanner, then you could write your own class that splits a string into a collection of tokens.
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner("Cotta and Balbus love the sweet voices of the girls");
while (sc.hasNext())
{
String nextWord = sc.next();
char c;
for (int i = nextWord.length() - 1; i > -1; --i)
{
c = nextWord.charAt(i);
System.out.print(c);
}
System.out.print(" ");
}
System.out.println(".");
}
|
|
|
|
|
Take a look at the Scanner class[^], which can help in the breaking up of words.
|
|
|
|
|
To get number of words in string u can simply split that string by space.
int[] words = string.split(" ");
int noofwords = words.length;
after getting number of words, loop the words and use reverse logic.
Regards
Vipul.
|
|
|
|
|
I want java code for fetch the details from my ms access database and those details are run in my program to excute the code.....
-- modified 5-Apr-14 7:44am.
|
|
|
|
|
Guyss i need just code for fetch details from msaccess database...
|
|
|
|
|
|
Hi guys , I do need help , cause i'm no a develloper but i have to do program on java that will read .txt file from database and get a specific String(FERME):
10/04/13 06:46 PS : 16 PN 239-Km 359.4 L.V K.ANI PN239 L/V: FERME
10/04/13 06:46 PS : 16 PN 239-Km 359.4 L.V 8V CdV C.J : 08.8 V
the file is made of multiple line like above, i just need to check if the file hade the word FERME....
thank you for your help
|
|
|
|
|
If that is all you need to do then it would be faster just to run the FIND command. However if there is more to it than that, and you are sure that you need a Java program, then you need to learn The Java Language[^] and the Basic I/O classes[^].
|
|
|
|
|
Sure I'm doing it but still :
-04-10-11:22:30. DEFAUT Z: .
RANDAN..
P0:.......
P1:.......
P2:.......
P3:.STA... 10/04 11:22
-04-10-11:22:55.............
RANDAN..
P0:.......
P1:.......
P2:.......
P3:.END DF 10/04 11:22
My files lines are structured like above,where the P1,P2..can change their states,at the specifique time,just want read those line and compare if the P1,P
,P3 states changed...please really nee ur help guys!!!...
|
|
|
|
|
mtouxx wrote: nee ur help guys With what? You still have not explained anything about your code or where it is having a problem/ What do you mean by P1,P2..can change their states,at the specifique time, or just want read those line and compare if the P1,P
,P3 states changed?
|
|
|
|
|
Ok i need a java code that helps me to read and check my file line by line, and in thoses line we get parameters, such as P1, P2,and P3, this file in to take on a data base, and each file get several lines
|
|
|
|
|
mtouxx wrote: i need a java code Well I'm afraid you are going to have to write it, as only you know what you are trying to do with the content of these files. The Scanner class[^] is probably a good one to help you parse the data.
|
|
|
|
|
Really appreciate thsi conversation such a helpfull!!!!..
|
|
|
|
|
But I think i better ask somewhere else!...
|
|
|
|
|
I think you may find the answers the same; no one is going to write this for you.
|
|
|
|
|
Someone kind enough I believe will help me..anyway think u for your attention!..
|
|
|
|
|
hello,
can any1 tell me how to develop a port scanner in java.I am not asking d entire code but atleast can any1 gimme an idea where 2 start from.
|
|
|
|
|
|
hello,
can any1 tell me how to develop a port scanner in java.
|
|
|
|
|
Google[^]
We can't do a lot for you if you don't give more details...
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
How to ask a question
|
|
|
|
|
I want to create a jquery dialog box which onlick of a image it has to load the dynamic page data and display. currently iam writing the code as below but its
not working.
var history = function(value, rowIndex) {
var id = this.grid.getItem(rowIndex).ID;
return "<img src=/img/showimg.jpg width=20 height=20 id=button1">";
};
<script>
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});
$( "#button1" ).click(function() {
$( "#dialog" ).dialog( "open" );
});
});
|
|
|
|
|
|
If I know
String IP = "127.0.0.1";
int port = 2020;
how an I estbish connection fomone client to this one in java Socket Programming.
I hae tried
Socket s = SocketFactory.getDefault().createSocket("localhost", Integer.parseInt(port));// sf = new SocketFactory;
but it is throwing exception.
Please help
|
|
|
|
|
The address "127.0.0.1" is the loopback address of your own PC, so you will need another program running there that is listening on that port. See http://docs.oracle.com/javase/tutorial/networking/sockets/[^] for the correct way to do it.
In future please do not just say "it is throwing exception. Please help". Provide the exact code that is failing, and full details of the exception or other error message.
|
|
|
|