verruckt24 438 Posting Shark

One approach would be to put a static method inside the JFrame class called getInstace() that would return an instance of the JFrame class (not necessarily new instance) you can restirct the instance to be single. Once this instance is returned you can call a non-static method on it.
E.g.

balance = JFrame.getInstance().getBalance();
verruckt24 438 Posting Shark

Don't you think Googling it and finding it out for yourself would be a better and more learning oriented approach ?

verruckt24 438 Posting Shark

Thats what I have been suggesting you since a long while ago.

verruckt24 438 Posting Shark

You are promising to waste a lot of any one's time who would be willing to help you by posting such non-questions. There must be a zillion text books that have this text, we would be more interested in knowing your specific problem (minus this commentary - obviously)
Also I suggest you read this before posting such..... essays should we call them ???

verruckt24 438 Posting Shark

We wont post syntax over here directly show us your effort for it first.
Also if MySQL asks for super privileges, you may as well have them. It certainly won't show incorrect errors.

verruckt24 438 Posting Shark

If you are able to detail what exactly are you trying to do by attempting to return the integer I think we could be of more use to you.

verruckt24 438 Posting Shark

If you are a beginner and would really like to take your skills to the next level, I recommend you use an Editor that offers the most basic capabilities, since it has been a personal observation that the more advanced IDEs people tend to use the more dependent they become on the IDE for the most basic of tasks.
Once you have reached a certain level of programming maturity and want to exploit the features that modern IDEs offer you can choose from among the many available. Since these have already been named here I won't repeat their names.

Having said that if you looking towards more advanced programming such as Swing GUI creation and stuff you would have to look at these right away.

verruckt24 438 Posting Shark

And I'm not going to post any more on this because of some other things that I believe.
No matter you win or lose a rat race you 'd still be a rat.
You can continue as long as you want, I'm here to do other more meaningful things.

verruckt24 438 Posting Shark

no, I didn't, but you just answered it yourself:

I'had thought you'd give some intelligent answer just as I gave to yours, but instead you are just copy-pasting my answers after I have put them in your face. You know it's so easy to appear intelligent when parroting intelligent people. ;)

Ezzaral commented: This is not constructive here. -3
verruckt24 438 Posting Shark

I never claimed to have delivered the most perfect code. I just based myself on his code and explained where he went wrong.
It's not my job to re-write his code to the most efficiënt form, it's his own task to find out whether or not there is a better way.

But atleast you can guide someone correctly if you are guiding someone at all. Do not guide someone wrongly.

And I hope now you get the answer for the extra '{' that you were commenting upon in the other thread. :D

verruckt24 438 Posting Shark
if(num=='8')
    pluralName="Eighty";
if(num=='9')
    pluralName="Ninety";
else
    pluralName="Error /w Plural Method";

this will always return "Error /w Plural Method", unless the value for num == '9'
what you want to do (and not only for the '8' check) is using nested if's

if(num=='8'){
    pluralName="Eighty";
}
else{
    if(num=='9'){
        pluralName="Ninety";
    }
    else{
        pluralName="Error /w Plural Method";
    }
}

This is a weak example of actually implementing it the right way, it should have been done using switch-case statement and using break as correctly pointed out by the above post. Also this method is far unoptimized since it would check for every 'if' till the num=='8' even if the very first 'if' statement is true. I don't think you want your program to check every condition on every occassion even if the very first condition is true in many of those occassions. ;)

verruckt24 438 Posting Shark

thats for him to remove, I just copied the code he has pasted a couple posts above in the thread. Its certainly not my job.

verruckt24 438 Posting Shark

Yes I recommend that too since I am not able to read your design properly due to confusing names. I would be in a better position to tell you your way around once I am clear with your database design.
I present here my suggestions from whatever I have understood of your db design :
1. What exactly are you achieving by placing a phoneNo_Id in the contacts table that refers to a phoneNumber in the master table ?
Ans : Nothing.
You could have as easily place the phone number itself in the contacts table.
2. Do you really think a phone number requires a unique identification ?
Ans : No. (You may think o/w but it doesn't really require)
Isn't a phone number unique enough by itself - (the phone company certainly would not allocate the same phone number to two different persons)

You are doing the same thing in the case of the Addresses. Check your design, by actually creating a different table for address and then putting an Id for that address you aren't allowing a contact to have multiple addresses whereas that's the exact thing that the professor asked you to do.

Based on this observations I feel that you have not correctly understood the concept of normalization of database. Reading these concept is central to being a good db designer, I would recommend reading the same. Any good db book would have an explanation for …

verruckt24 438 Posting Shark

I think you would need to use Stored Procedures for this. Check MySQL Stored Procedures for their usage.

verruckt24 438 Posting Shark
if(input == 0){
        {
            numOneLow = numOneTensLow + numOneOnesLow;
            numTwoLow = numTwoTensLow + numTwoOnesLow;
            numThreeLow = numThreeTensLow + numThreeOnesLow;
            System.out.println(lowproduct);
        }
        else(input == 1);
        
                numOneTensHigh + numOneOnesHigh;
                numTwoTensHigh + numTwoOnesHigh;
                numThreeTensHigh + numThreeOnesHigh;
                System.out.println(highproduct);             
            }

I don't think this approach would always work.
E.g. 96*85*74 = 603840 whereas 76*85*94 = 607240 you will have to try out all possible combinations of them and then check for the maximum among them as shown by me in post #6

verruckt24 438 Posting Shark

@leox99 : (In reference to my above post) I hope that you are able to make a design and the related coding for that from the write-up you have given above, and if you have any specific coding related queries I and the entire army of the forum members won't hesitate to help you. ;)
Happy Coding.

verruckt24 438 Posting Shark

Normally I would move over this thread by just saying "ask specific problems or we are not here to solve your assignments" or something very similar. But the sheer amount of such posts makes me think that may be these guyz are really lost and may be they will be able to figure out their way if someone would able to give them a start.
Well while that doesn't certainly mean that I will be giving you ready-made answers, what that does mean is that I would be willing to tell you what I would do if I was in your place given the same assignment/problem you have : (I am sure that there are even more talented people here who would certainly have a better way of doing it, this is just mine)
First I would go on reading the problem domain again again, twice, thrice may be even more, till I am able to extract a central theme for the problem domain, (in this case the write-up about the porblem you have) that describes the problem in a statement or two. Next develop an architecture for the system as a whole that would fit the central theme and that visually, or otherwise, describes the central theme. Moving on I would go about dividing the main architecture into modules and concentrate on the goals that these modules are supposed to achieve which would make way for the design of these modules. Working similarly these modules would be …

verruckt24 438 Posting Shark

@umairsario
First you posted entire code which should not be done as this place does not sanction that. Then even after you were told you posted entire code (changed) a second time violating the T&C a second time. Third you are not even guiding someone the correct way by posting such nonsense code. (The pattern should be printed using nested for loops) as javaAddict rightly points out. Fourth you are trying to squeeze in your question, which has been asked in another thread on this same forum, in one of your posts here.
Are you trying to make it to the guiness records of "number of wrong things done in one post" or something like that ?

verruckt24 438 Posting Shark

Java Programmer and Sun Systems Administrator

Sorry masijade I happened to look at this a few nanoseconds later I posted the second post. Did the slim chances just get FAT ? ;)

verruckt24 438 Posting Shark

yes it might happen that the author/developer might be going through this forum looking for such untidy posts - as you say the chanes are slim - and in that case the poster might be able to get a 100% accurate explanation but the master links would certainly not carry wrong information and that my whole point which is summed up in the last statement.

verruckt24 438 Posting Shark

What is it that you want ? You have already been given the links for that, still you ask for an explanation. But I guess the links would be carrying an explanation itself but in the words of the author who developed the Abstract Classes and Interfaces themselves or in the words of the someone else who the authored trusted to be smart enough to be able to explain that. Now still do you want an exaplantion in the words from someone from among the forum - who would not be someone the author/developer trusted to do the job.
I am not saying that the explanation you would get from here would be wrong but my point is, that the explanation you would get from the links would almost be horse's mouth stuff.

verruckt24 438 Posting Shark

Also to get you started on it...when working with a OO langauge always break down the problem domain into classes and methods.
You have most of it done since you have been given classes too. Now you can identify the individual methods that should be put into each class and write your code.

jasimp commented: Very helpful +9
verruckt24 438 Posting Shark

hmm... sounds like an assignment to me, show us some code which asserts us about the work done by you and as mentioned above ask specific questions where you might get stuck up, then we may be able to assist you further.

verruckt24 438 Posting Shark

There's no better way to explore and understand the Java language then to go through the javadocs, it helps you tremendously (Thats my opinion ;-))

verruckt24 438 Posting Shark

and yes I know you aren't "CEO" of anything, you and the people you call "Experts" are just a bunch of guyz just passed out from some master's course - or may be even not maybe you are drop outs - in hope of making quick money.
Don't try to fool others with big names, you would be making a fool out of yourself instead there are smart people here.
FYI : I was studying at the Pune University for four years and I know how desparate people are to get a hand on "ready-made" projects to make their grades.

verruckt24 438 Posting Shark

Are you planning to connect the applet to a database on the server ?
Provide more details so that we can help you.

verruckt24 438 Posting Shark

Could you detail a bit more.

verruckt24 438 Posting Shark

What the hell are you guys doing here ? This isn't somekind of advertising board for corporates. This forum's main aim is to make people learn while they are being helped. You want to show that you are helping people while making them dependent - not to talk about making greedy porfits for your own organisation.
What you are doing is outright cheating, you are showing people way to cheat their professors/tutors when actually this place's culture promises to be the exact opposite.
Don't make porfits for yourself at the expense of others. I doubt the experts you so boast off are really 'experts' at all otherwise you would be wanting to make larger, complex commercial projects instead of exercising their epertise in school/college - in short kiddie - projects. I hope you get it !!!

stephen84s commented: Couldn't have put it better +3
Salem commented: Good post +23
verruckt24 438 Posting Shark

In my opinion this is a better way to do that, in looping you would have to customise the loop in a way that it runs only for set of values that you need for e.g. no repitition of the digits etc this way you would have to take care of a lot of conditions which would make the code complex. Hence I say that the method shown above would be a more cleaner convenient option.
Also since the repetition is not allowed you actually have lesser combination of digits to evaluate so that you can write out all the combinations by hand (which I guess won't be more than 4-6)

verruckt24 438 Posting Shark

the compareTo function in String class compares two strings lexicographically.

Read javadocs for more details, I'm sure they would help.

verruckt24 438 Posting Shark

I think you need to do something like this :

highProduct1 = (numOneTensHigh + numOneOnesHigh) * 
					(numTwoTensHigh + numTwoOnesHigh) * 
					 (numThreeTensHigh + numThreeOnesHigh);
	
	highProduct2 = (numOneTensHigh + numTwoOnesHigh) * 
				    (numTwoTensHigh + numOneOnesHigh) * 
					 (numThreeTensHigh + numThreeOnesHigh);
	
	highProduct3 = (numOneTensHigh + numThreeOnesHigh) * 
					(numTwoTensHigh + numTwoOnesHigh) * 
					 (numThreeTensHigh + numOneOnesHigh);

	highProduct4 = (numOneTensHigh + numOneOnesHigh) * 
    				(numTwoTensHigh + numThreeOnesHigh) * 
    				 (numThreeTensHigh + numTwoOnesHigh);
	
	// This way try all combinations, if there are left any others ;-)
	// then get the max of them.
	
	if (max < highProduct1)
		max = highProduct1;
	
	if (max < highProduct2)
		max = highProduct2;
	
	if (max < highProduct3)
		max = highProduct3;
	
	if (max < highProduct4)
		max = highProduct4;
	
	// In the end print out the highest product
	System.out.println("Highest product is : " + max);

You can do the same way for the Lowest product.

verruckt24 438 Posting Shark

But for that to be an actual CSV file it should have different values separated by commas. Are you separating out values using commas ?

verruckt24 438 Posting Shark

First of all you must really be working on some top notch "classified" project that you are feeling so vulnerable to divulge the details off. But just imagine how helpful we can be if we do not even know the problem domain for the project.
And also it isn't so bad to correct yourself if someone asks you to do the right thing the right way.

verruckt24 438 Posting Shark

I could help you with a little bit of help from your side first.Pls detail your problem and also comment your code wherever appropriate.

verruckt24 438 Posting Shark

How to simulate protocols in Computer Networks

You know what... I can read your mind even while you are offline and exactly know which protocol you want to simulate on what networks and what your assumptions/restrictions are.....But I simply DO NOT want to to help.

verruckt24 438 Posting Shark

Again you have posted the exception without much detail for e.g. line no. Also since oyu haven't put in your entire code and since also your code is not indented properly it is difficult figuring out where the exception would be and hence why it would be occurring at all.
Still I present a hint here : Nullpointer exception occur at places where you use a null reference. This would be where you are using the dot operator (.) and the reference on the LHS of it is a null reference. IF you can figure out yourself where this would be happening in your program - great, but if not you can help us by posting the code part in question e.g. the main method and the entire stack trace with line numbers for the code part.

verruckt24 438 Posting Shark

I feel you are posting your class assignments here one by one, while we do not have any problem outright with that there should be some effort from your side that comes across from your query/ problem. We haven't seen any such effort as yet from you on this post.
Read this before posting such queries here.

verruckt24 438 Posting Shark

Please mention in detail what Exception you are getting.
BTW are you getting an ArrayOutOfBoundsException ?

verruckt24 438 Posting Shark
int r1, c1, r2, c2;
	int[][]cards;
	cards=new int[4][4];
	for(int r=0; r<4; r++)
	{
		for(int c=0; c<4; c++)
		{
			cards[r][c]=(int) (Math.random() * 8);
                        // the line below should be commented
			System.out.print(cards[r][c]);
		}
		System.out.print("\n");
	}

I have mentioned the changes in the code itself (check the comment)
As I see here you have not been taking note of some of the conventions mentioned to you. What you have rather done is just for the sake of doing it have indented the code in question and have kept all the other code part as it is. The conventions sited as for your convenience and not for ours. If you want to plainly discard the guidelines mentioned to you while keep on asking for help I don't think this is the right place for you.

verruckt24 438 Posting Shark

On the other hand, decompiling/reverse engineering platform dependent executables and libraries [static and dynamic] is no easy feat and definitely can't be achieved by a casual script kiddie or a curious programmer; it requires much more expertise.

yes thats exactly what I was trying to put through, but I incorrectly qouted myself which obviously did not go down well with some of the members. No issues and I admitted it.
Thanks.

verruckt24 438 Posting Shark

What you have given is a problem domain. You can work up the design and tell us where you get stuck up implementing it in langauge, we would help you there then.

verruckt24 438 Posting Shark

??? You can run java on linux. Thats the whole entire point of java, is that its Write Once Run Anywhere. A java app should run exactly the same on linux, unix, osx, cellphones, windows.

Completely agree with you, but I guess Stultuske is mentioning the .exe files over here.

verruckt24 438 Posting Shark

Okay mistake agreed and apologies to the one's hurt.
Thanks for correcting me.

verruckt24 438 Posting Shark

Hi,
I was recommending just a course of action to a person who seems to be in need. But you look to be insterested in restricting the power of langauges so much that nothing other than the opinions you have seem to be valuable to you. We are certainly not here to discuss how much you and I know, but to solve each others problems. I have just expressed my opinion and the original poster can as well not take my opinion if he feels so. But atleast I offered a solution which you did not even try to. You seem to look so busy in showing off your knowledge.

verruckt24 438 Posting Shark

There are two ways you can do this. One of them is as described above to pack all .class into one executable jar file which can then be run on any PC that has JRE installed. This can be done through the use of a manifest file (you need to write the main class name into the manifest file so that it knows which class to run). You can lookup this procedure on either the Sun's site or any site that has information for creating executable JAR's. One risk that this procedure runs is that you are basically shipping all your class files which can be potentially decompiled and your source code be exposed to other parties. So if you have the concern of keeping your source code closed you can use the second method mentioned here.
The other method is to use some kind of Java-to-EXE converter software which would take all the class files and optionally the manifest file as input and produce an EXE file as an output. Some of them take theexecutable JAR as input. Shipping an exe file essentially keeps your source code protected. You can also optionally have JRE embedded into the EXE creator during input so that if the target PC does not have JRE installed already you can do it automatically. One such tool is the JexePack which we use, but since this is a licensed s/w you need to purchase copies of it from the vendor.