Manoj Kumar Jain

Ranch Hand
+ Follow
since Aug 22, 2008
Manoj Kumar likes ...
Oracle Java Linux
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
18
Received in last 30 days
0
Total given
66
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manoj Kumar Jain


Dont look at my code is false i know .Read the text there are a lot of things i should do and i cant


Hi Ekte,
You need to share what you have tried, what you were expecting and what was the output (may be some error message). if you can point out the problem where you are stuck we can help you out.
8 years ago
Jeff,
First of all you need to have 2 for loops in this case. Think it like you pick the first value from array (keep it fix) and compare it with all values(except itself); Then you pick the second value from the array (keep it fix)and compare it with other values and so on.So your first for loop will provide you first value and second for loop will provide second value to compare.
Your solution is checking for adjacent values so it will work only when there is confirmation that same values will always appear together. Can you think of a case where same values will appear together? Can you modify this array to become like that. If you can think of this then your solution will also valid and this will be second solution to this problem.
8 years ago

Haider Mezta wrote:So Once you run that code it will ask your name and your age. and once you type your name it will increment it into 5. Below is the Output of the above code.

Hello. What Is Your Name?
John
How Old Are You?
25
Hi John How Are You?
Did You Know That In Five Years You will Be 30 Years Old.
And Five Years Ago You Are 25 Years Old.

So What I want is if I type number on the Character field when it says "How Are you" a message error will display like "Please Enter Character" or if I press enter without typing any character it will also display some message says that "Please type a character" and it will switch back to the question "What is Your name" and this should be the same on the age field. I've done some coding but I'm still having some problems it doesn't give me what I expect. Please help me please



I can provide you some points to move ahead in making some progress, may not be the best solution at this time.

1. You need to check on the input provided by the user for any digits. You can use regular expression here but as you are just starting ( I think so) you can check for individual digits from 0-9. You can also create array of integers 0-9 and check input string for presence of any element in array. String class provides contains() method to check any substring/char in given String.
2. If you see any digit you can call the main method again, that will start asking questions from user again ( starting from the name).

I think if you work with above points you should be able to have working code that can be modified further to have better structure.
8 years ago
Look carefully, the method is not returning 1, Its comparing the result of jdbc.update method with 1.
If both are equal it will return true else it will return false.
8 years ago
You need to check age of each student to determine if he/she is adult or not. Each time you encounter an adult you will increase the counter. As you are reading inputs in loop so you will
1. Have to check if age meets with adult criteria (if condition)
2. Have to increase the counter when age meets the condition(counter++) otherwise do nothing.

and off course all this will happen inside the loop unless you want to store ages of all students somewhere, which is not required.
8 years ago
I can see in the line number 36 you are printing the object type of Contacts

When you call System.out.println() method on some object; It calls the default toString() method of that class (in your case this is Contacts Class)

The default toString() methods returns the String like getClass().getName() + '@' + Integer.toHexString(hashCode()). This is happening in your case.

If you want to have a good human readable output just override the toString() method in your class Contacts. Its also a good practice to override this method.



9 years ago
You need to import Product class in your shoppingitem.java before you use Product.

As someone already mentioned and I can also see in your snap shot you haven't imported that.
9 years ago
Thanks Ivan, Yes this is Linux box having shared drive..
10 years ago
Hi,

I am having a desktop application on the remote machine that I need to run. so, I am launching the application like below.

\\172.168.1.2\folder1\folder2\java\java.exe pkg1.subpkg1.MainClass

I am calling the java.exe of remote machine and also the class from remote machine itself. (please ignore syntax mistake)

My query is that when I launch the application from my local machine, from where does it consume memory from local or from remote machine. Is it running on the remote machine or on local.

I can see the javaw.exe running on my local machine but that is taking very less memory(when saw Mem Usage in task manager) so rest of the memory is allocated on remote itself ?
Please help !
10 years ago

Salman Mushtaq wrote:Hi ! dear now the problem is that how i make menifest of multiple files . . . jar file ?


If you want to wrap your executable jar file into an exe file you can do it easily by using iexpress facility from windows. write "iexpress" in start > run and hit the enter button.
This will ask for the parameters/path, Follow the simple steps and you are done.
Apart from this you can use some open source tool to create a exe from your jar file like JSmooth.
10 years ago
Hi,

I have seen many times on Facebook that people share the picture of "some person/child suffering from cancer(or some other disease)" saying that if you share/like this picture Facebook will give/donate 1 $ for each share/like to patient for cure. I never believed on such messages and don't share/like these pictures. But I have seen many times that even person working with big IT organization share such things in the hope that the patient will get some money from Facebook.
Now I am wondering how many of you think that Facebook gives money to patient on sharing/liking such stuff and how many of you ever shared such stuff.
11 years ago

ahmed mego wrote:How can I get the variable "n" in the void method:
i know that void return null but there are any solution for that



void method can't even returns null. It returns nothing.
11 years ago
I just Love it... superb !!!
11 years ago
Thanks all for your replies. I got it now.
11 years ago
Hi All,

I can see a cow symbol against the post of some moderators. This is appearing in the left side where the users info appears.

what does it means. Please help me to understand it.

it appears below the following data in the left side:

Joined: Oct 13, 2005
Posts: 30159



Have a nice day !

11 years ago