if we write synchronized before any method it will get synchronized. but in this program what is the solution i am not getting.
Type: Posts; User: snehasishmohanta@gmail.co
if we write synchronized before any method it will get synchronized. but in this program what is the solution i am not getting.
yea i already did that .but i am stuck in the next part means synchronization of method.please help me to write that code.
actually i wrote the below code.
but i am getting o/p-
i want to create two thread one thread will print odd number and another thread will print even number. but the number should be in a sequence like
help me.
yes i know. but from my point of view some special differences are.
if any more important thing there kindly share with me.
sir , i faced a strange problem. i went for an interview. that interviewer asked me
i was unable to answer properly. any how i managed i answered
i think you are saying about the for loop. yes i got that.
--- Update ---
you are looking very helpful person. can i have your facebook profile???
--- Update ---
many many thanks to you.....
it's looking more complicated . i am not getting what is 9 & 5. :confused:
that thing i am not getting... how to use the loop... please help me.
how to put index in a loop.
sorry for the silly question. actually i am coding from morning now it's 8.00 pm. i think codes are fighting on my head. i think i need little free time to brush up my mind:P. sorry to take your...
yea i tried. but after splitting the string i stored in the array and then swapped the first element with the last element.after that i got confused again for converting that array element to...
if i will get the i/p through scanner. how can i get the last element of that array
let the array name is i
if the length of the array is n
will it work??
--- Update ---
thanks.. but...
actually i am not getting the logic for swapping.... actually the question was a big question and its the small part in which i am getting problem.
i solved all the part.but stuck on this part. so i...
first word would be swapped with last word and all the alternate word.
e.g
i/p-
o/p-
there are 6 word:- 1st place will be swapped with 6th position
...
yea that i have already done... but after that i am getting confused how to swap. can you write the looping code for swapping.
i need a help...
i just need the logic..
i want to swap the word. how could i be able to swap..
for example:-
I/P:-
O/P:-
please help me with this
String s1="welcome";
String s1=new String("welcome");
i got it thanks for your help everyone
import java.util.Scanner;
public class SentenceReverse
{
public static void main(String[] args)
{
Scanner scn = new...
i am getting problem in this program please help me..
Write a program to reverse each word in line(sentence)?
if i will give input as a
o/p would be --
ih woh era uoy
import java.util.Scanner;
public class Demo3 {
public static void main(String[] args)
{
Scanner scn=new Scanner(System.in);
System.out.println("write a sentence");
...
i am getting problem in this program plz help me.. :(
Write a program to reverse each word in line(sentence)?
thanks for your valuable tips... i got it.....
import java.util.Scanner;
public class Demo2
{
public static void main(String[] args)
{
Scanner scn=new Scanner(System.in);
i am new to programming skills it may be silly question for experience but for me it's new thing. actually i tried a lot but i am facing problem when i trying to take input through Scanner.
if i...