verruckt24 438 Posting Shark

how to create a program?

What do you think are you doing ? Just read the original post and the answers before posting blindly.

verruckt24 438 Posting Shark

Please take time to read the sticky at the start of the forum. It does mention a lot of stuff beginners might need. Also read some of the forum rules. Before you ask a question it is always a good thing to see whether it is already answered. In the case of your question it has been asked so many times as to be qualified to put in a sticky at the start.

verruckt24 438 Posting Shark

That is because this code does not read each n from the file, it just reads once from the file and sets it to maxDen thats it. You would require to read n and set it to maxDen every time so that it would require another for / while / do-while loop. Thats what the assignment statement reads

Requires nested loop with the inner loop summing up series and outer loop allow inner code to repeat once for each n read in from file

verruckt24 438 Posting Shark

What is the output you are getting ? Tell us where exactly are you facing problem.

verruckt24 438 Posting Shark

If you are compiling from a different location then you'll have to specify the path where the class Dog is supposed to be found by using the -cp (classpath) option. By default it would only search in the default directory and the paths specified by classpath environment variable.

Read more about classpaths and packages.

verruckt24 438 Posting Shark

Ahhh.... You write a post about something that seems to you as though it would be helpful, but then someone down votes you. So much for the trouble. :)

java.. commented: ridicule someone's reply... +0
verruckt24 438 Posting Shark

in DogTestDrive class check whether you import Dog class or not ..

Not at all necessary. If both the classes Dog and DogTestDrive are in the same directory then it isn't required that the referring class requires to add an import statement. This is true even if the Dog class is not mentioned as public. If you do not mention a class as public it's access specifier falls to 'default' i.e package access but since none of the classes are within a package and rest within the same directory the access is permitted. Both OP and you can try it for your self.

Now if your class Dog is in a package let's say "foo.bar" and your DogTestDrive class too is declared within the same package then the case goes back to the first one as explained above. Then effectively both these classes are in the same directory and nothing needs to imported and in fact, as mentioned above the Dog class doesn't even need to public in that case. But if your DogTestDrive is in a different package or more specifically not in the same package as that of Dog (since it can be in no package at all) then there are 2 things required for the DogTestDrive class to compile successfully. Firstly it needs the Dog class to be public, because if it isn't then it simply isn't accessible to outside packages so the import statement even if it exists isn't gonna do you any good. Secondly, …

verruckt24 438 Posting Shark

hai this thread is posted by me
i just signed into the site n i am shocked to see the arguments
n someone marking unclear to masijade!!!
i am new to this site n as far as i know he is highly talented n has good patience in clearing the doubts of people
and i think this site is for people to develop their programing skills and so i think its not so good to spend our time in this way instead of discussing and improving ourselves
thank you

All this, by the person who started this crap in the first place. When Salem wrote "Have you ever heard of a search engine ?" He meant to ask you in a very polite way that why wouldn't you consider searching something on the net first. Not only this, we have a lot of such threads started by you. Consider searching as the first option before you post anything, read the rules of the forum about posting and asking for help and while you are at it up vote the post masijade so kindly wrote for you.

verruckt24 438 Posting Shark

Class Player, wherever it's declared needs to have a constructor having the signature

public Player(int, int, int, int, java.awt.Color, lang.String){
}
verruckt24 438 Posting Shark

i didnt get u

He probably knew you won't.

verruckt24 438 Posting Shark

I suppose here, the word interface doesn't mean the Java language type. What it wants to mean is a contract, much like how it is between a library developer and it's user. The word here maps more closely to the method signature. Something like "overidding allows multiple methods to have the exact same signature" so "one interface, multiple methods"

PS: On reading JC's post again, I guess he's trying to say the same thing.

verruckt24 438 Posting Shark

post your code

Hmm...wasn't that advice already given ?

verruckt24 438 Posting Shark

post your code, check with the instanceof operator in java what instance is actually residing in the ExitInterface type variable.

verruckt24 438 Posting Shark

What you could is traverse the entire string, character by character. At each character, check the char and increase it's count. You would have to maintain 26 different counters - one for each letter of the alphabet.
Use the switch-case construct to check the chars. Something like below:

switch(char){
    case 'a' or 'A': {aCtr++; // increase a's counter
          break;} 
    case 'b' or 'B': {bCtr++; // increase b's counter
          break;} 
    // rest of the code...
}
verruckt24 438 Posting Shark

Make sure the jar file is in path. You can also specify the location of the jar file through the "cp" flag.

verruckt24 438 Posting Shark

Yes, I missed that one. For MySQL you should be using this driver.

verruckt24 438 Posting Shark

You need to add port information in the URL. MySQL's default port is 3306 so unless you have made any changes to it that's whats missing. Try adding the port number after the localhost.
Also sometimes localhost doesn't work so try 127.0.0.1. But this is certainly the problem that I have faced so in your case it might not be.

verruckt24 438 Posting Shark

Where are you using the counter to check whether it has been incremented or not. Post the entire code.

PS: He beat me to it.

verruckt24 438 Posting Shark

Why is everybody handing out code snippets to the OP here ? Since when did it became the most easiest way of giving solns ? Not to mention some of you have got the assignment wrong completely.

If you could see two of the more senior posters here have both given the solution without providing the code for it. Thats the way it should be done, you make him understand the solution by outlining steps using pseudocode, Simple English etc but I guess not many people here know that way.

verruckt24 438 Posting Shark

Why is everybody handing out code snippets to the OP here ? Not to mention some of you have got the assignment wrong completely.

If you could see two of the more senior pros here have both given the solution without providing the code for it. Thats the way it should be done, you make him understand the solution by outlining steps using pseudocode, Simple English etc but I guess not many people here know that way.

PS: I don't know how and edit caused it to be posted twice, just ignore the next post of mine.

verruckt24 438 Posting Shark

From what I have understood you need to do, it is something like this:
You have created/worked on the project on a different computer on eclipse and now you want to switch the machine for some reason. If this is what you need to do, follow the below mentioned:
1. From the main menu bar, select File > Import.... The Import wizard opens.
2. Select General > Existing Project into Workspace and click Next.
3. Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects.
4. Under Projects select the project or projects which you would like to import.
5. Click Finish to start the import.

This is straight from the Eclipse Help Contents, for further details select Help Contents from Help menu and type "importing existing projects".

Tell me if this helps.

verruckt24 438 Posting Shark

new keyword dynamically allocates memory for an object..

http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html

refer to the above link....
and you two plz dnt fight here....its nt a battleground..

Good you woke up from your sleep, but before posting please check the dates. Nobody was fighting on the thread and whatever the matter was was long closed before you decided to reopen it by bumping the thread. And one more thing the OP is certainly not waiting till now to know what the new keyword really does.

verruckt24 438 Posting Shark

While compiling you need to specify the .java file, you are right on that part, but while running the file through the java command you cannot specify the .java file, such a file won't simply run, the JVM would need a .class file. So you would have to execute the command in this way :
javac HelloWorldApp the class loader would look for a file with that name and a .class extension.

verruckt24 438 Posting Shark

Thats because you haven't have implemented the toString method for your objects Address and Name. You need to implement them to define the behaviour of the toString method for your object. For e.g: for the Name object it could be :

public String toString(){
    return this.firstName + " " + this.lastName;
}

In case you do not provide such an information the toString() method as defined in the Object class would be executed, which just returns a string representation of the object concerned.

Note : Incase you are worried from where does the question of the toString method getting called arises in the first place, well that is the method that would be called when you attempt tp print out a copy of that object.

verruckt24 438 Posting Shark
verruckt24 438 Posting Shark

@serkan : The reason you cannot argue with Narue over this, or more appropriately, should not, is that even if people are working for 10-12 hours, can't they learn on the job itself ? Thats what Narue wants to mention when she says that to not learn anything from the job, they should be doing a job where they are absolutely not allowed to "think".

When I started my internship, in the organization that I currently work in three years back, I used to stay back in my office as long as I could sometimes staying over in the office too, because fresh, not to mention naive, as I was just out of college, I was eager to soak in as much as I could and as fast as I could. That was the time when I learnt a lot of new things whether in programming, or just being social whatever, I never felt the need to go learn something apart from just doing my job, I learned so much during that time. Contrary to this many of my friends got home early working for as few as 7 hours and I am ready to bet that they did what Narue is ready to bet her money on. ;)

verruckt24 438 Posting Shark

As hardik.rajani mentions there's is little programming "tradition" to this.

The concept of the Top of Stack is that the Top should always point to the uppermost/topmost element in the Stack.

Now to follow this concept, it would be a logical thing that you first need to increment the top counter by one so that it points to an empty position in the Stack (the new top) and then enter an element at this position, so again after the completion of this operation our view of the Stack is consistent of the Top pointing to a the topmost element.

This is in the case of the Array implementation of Stack, and since we know arrays have a beginning index as 0 we cannot have the top pointing to 0 as in that case it would wrongly be conveyed that there exists a single element in the Stack. So we keep the top pointed to something that is one position lower than 0 (-1) so that the operation of adding elements to the Stack performs as mentioned above:
1. Increment top by 1
2. Add element to top

The remove/pop operation proceeds this way:
1. Copy element at top position
2. Decrement top by 1
3 Return copied element.

Following this procedure we can be sure that if the top points to -1, the Stack must certainly be emtpy, thats the reason we check the top being equal to -1 for …

verruckt24 438 Posting Shark

Just one more suggestion that comes to my end (it's a crazy one): Go looking for female psychiatrists in your locality of your age, tell them about this problem of yours, tell her you want many sittings with her not just a few, by the end you'll either have found a "smart and deep thinker" or atleast would have cured yourself of finding one. ;)

verruckt24 438 Posting Shark

But Mr. Sendur, it's like you are in search of water and where are you looking for it ? In the dryest of the places of the World. Got the point ?

What are you doing searching for a smart, deep thinking, intelligent young girl near a strip joint. Not that those girls lack feelings or emotions - but any girl with atleast one of those virtues would not be found in an area within 5 km of a strip joint. So stop looking for water in the desert and start by looking for it in the most greenest of the places, the chances of you finding a source are a lot better.

As mentioned earlier, if you want a deep thinking, smart young girl for yourself, go get a few girl-friends, start understanding what they normally look for. And it won't be so difficult to find someone, get yourself involved with a local community of say programmers or thinkers, try finding out smart girls in your college etc., and don't waste too much time at the strip joints or else by the time you reach the college looking for smart ones all of them might already have been picked up by other smart ones.

verruckt24 438 Posting Shark

I ain't finding much time apart from my work place to code anything. At workplace I need to build a small router/accounter for text messages that determines from the prefix of the destination (mobile) which gateway to route this message to and to search what price the user has been allotted on that gateway. This needs a lot of db table information in memory as I can't keep querying around for the information and I use the data structures from the Collections package for that.

A small JIT compiler/runtime assembler thing. Lost all the code I had on a thumb drive, so I have to start over(better this time).

You seem to doing something that I find interesting, could you tell us more about it or point to resources ?

Also William is working on another interesting activity of compression. Could you too tell us more ?

verruckt24 438 Posting Shark

I fail to understand why this thread is named what it is. No one's interested in Rashakil Fol anymore I guess.

verruckt24 438 Posting Shark

My goodness Serkan, living in the US hasn't had much of a positive effect on your English langauge skills, now have they ?
;)

verruckt24 438 Posting Shark

As i stated above, my "i love you" thing is only valid for one individual, and everybody knows who she is.

This isn't a nice thing to say, especially when that someone has announced her discomfort with such stuff. I don't believe much in casting people in religious moulds anyway so I won't be talking about religions, but respecting other people's feelings is something that I guess comes under the one religion we all belong to - humanity.

I love reading some of the threads started by you Serkan, sometimes when I get dizziness out of work I like reading your posts, they lighten up the mood. I also support the thought that a little bit of joking and kidding around, healthy arguments and debates only nurtures relations and brings out good knowledge. But I suggest that one should know where to draw the line, and where to call it quits, and please make sure you don't step on other people's feet here.

verruckt24 438 Posting Shark

I should say I have to agree with Serkan Sendur here in this thread. I'm not saying that I have the same feelings for Narue as he does, but I mean I agree with him when he says "You have the liberty NOT to read this thread"

I don't know why Nav33n and MosaicFuneral, (and don't take this the wrong way guys) have to act like some personal bodyguards for Narue. Don't think at all that I endorse the way Serkan talks about Narue or anything else, but c'mon guys don't crowd up on someone, Narue is quite capable of handling such things, let her and Serkan sort it out. I say this because I have seen a couple of threads by Serkan where he says something and then all the other members just mob up on him trying to tear his every post apart. If he does or say something wrong the moderators would take appropriate action against him but let us not be judgemental about anything and everything that he has to say.

MosaicFuneral commented: He's just so easy to play with. +3
verruckt24 438 Posting Shark

Read this thread.

verruckt24 438 Posting Shark

If you want to replace all the occurrences of the word take a look at the replaceAll method, else if you would just want to replace the first occurrence of it, use the replaceFirst method. If you still want to do something else, such as replace an occurrence of the word after an occurrence of something else, wellm I have sited here the docs for the String class you can have a look at all the methods it has to offer and decide which suits you best or you could use a few of them in combination to get the desired outcome.

verruckt24 438 Posting Shark

You need to put the two abstract methods eat and move in the Animal class like :

public abstract void eat();
public abstract void move();

This is part of the "contract" of being an "Animal". Any object that "inherits" from Animal should implement these two behaviours. So in programmatic sense any class that extends the Animal class should provide a "specific" implementation of eating and moving, so in essence you should write the eat and move methods.

So instead of putting the System.our.println statements in the display method you could put them in the eat and move method individually and then in the display method give a call to these methods.

verruckt24 438 Posting Shark

@ClimaxBeetle: I appreciate your use of code tags in the very first post. But you haven't mentioned what your problem is, tell us why you have stuck.

verruckt24 438 Posting Shark
private JLabel celsiusLabel;
private JLabel fahrenheitLabel;
private JTextField tempTextField;
private JButton button1;

public static void main(String [] args){
    new CelsiusConverterGUI();
}
verruckt24 438 Posting Shark

> few different ways
And what were they ?

>how you would incorporate a main method into this program?
By writing:

public static void main(String [] args)
verruckt24 438 Posting Shark

Maybe the people cheated to pay their taxes, so with scarce funds maybe the govt. sponsored his education in parts so it took 9 years to get it done.

Why are people here so non-understanding.

verruckt24 438 Posting Shark

No I did not because I was short on time and used the short, regex, instead, see my previous post. ;)

verruckt24 438 Posting Shark

What you could also do is read the file line by line, the same way as you are doing now and match a pattern in the read line using the String class' matches method. Where the pattern could simply be the string to be found in the file.

Note : The StringTokenizer is a legacy class and is use isn't recommended this is what the java guys have to say about it. StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead. In your case, instead of the split method the matches would do the job, which itself uses regex.

verruckt24 438 Posting Shark

This is pretty straightforward. you just need to convert these conditions into langauge syntax. You would need an if construct over here and since you need to check both the numbers you need a conditional operator. You can check these things out on the java tutorial site.

verruckt24 438 Posting Shark

>If both numbers entered are over 100, then subtract 100 from each
>If both numbers are negative then add 200 to their sum.

Isn't this what you want to put in in the loop ?

verruckt24 438 Posting Shark

>I am getting an error for the last line it is saying the maxOutput and minOutput can't be resolved.

Thats quite accurate on the part of the compiler. The reason it says this is because of this :

String maxOuput = "The maximum of your integers is: " +num1+ " + " +num2+ " = " +max+ "\n";
String minOuput = "The minimum of your integers is: " +num1+ " + " +num2+ " = " +min+ "\n";

In both places you are missing the 't' in the Output.

verruckt24 438 Posting Shark

>i create another constructor in d class and declare another statement outside the loop..

Are you creating another instance of 'fermi', I am not sure how that helps, but anyways if it solves your query, just mark the thread as solved.

verruckt24 438 Posting Shark

Instead of giving us th broad description of what you were supposed to do to start out with, where we have to figure out each and everything like the logic, methods, variables etc., give us directly the error that the compiler is throwing at you or tell us where you are stuck.

verruckt24 438 Posting Shark

The problem is you declare 'give' inside this while loop while(quit !=-1) but then this loop ends at the '}' after give.totalPlay(); , so that the 'give' variable goes out of scope and at this statment JOptionPane.showMessageDialog(null,"total play is "+give.totalPlay()+"\ntotal win is"+win+"\ntotal lose is"+lose); the compiler cannot find a declaration for give.

Move the declaration for give outside of the while loop so that it doesn't fall out scope before you want to reference to it.

verruckt24 438 Posting Shark
Select resortname from table2 where resortid = (select MAX(resortid) from table1)

Try this.