verruckt24 438 Posting Shark

Method is Infix2Postfix instead of InfixToPostfix

verruckt24 438 Posting Shark

Your question doesn't make any sense at all do you understand that ? When you say "difference" it could be like what is the "difference" between iPad and iPad2 or between Windows XP and Windows Vista etc The difference is what the difference is between any two successive versions of software/hardware etc. It could be as simple as "x.x is an improved version of x.(x-1)". If you want a list of all changes, fixes, enhancements, additions etc I guess Sun/Oracle better answers the question. So google.

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

How long can some take to Master java programming?

No one can answer this. Because the true masters are so deeply engrossed in what they do, they are so blissfully doing the thing that to them it no longer is work, it's play. Those ones would have lost the track of time long before the thought even crossed their mind or may be it never did.
The others who can tell you the time it takes to master would be incorrect, because they are to put a lot more time than that, precisely the amount of time that would make them lose the track so that they qualify in the first category.

So to sum up there's no right answer, and the good thing is you don't even have to worry about it. Start doing it and if you find it so good as to being thoroughly enjoying it, you won't need an answer.

and BTW please do take time out to read what s.o.s points to "Teach yourself programming in 10 years" it's one essay every aspiring programmer should read.

verruckt24 438 Posting Shark

In addition to what masijade said:

Write a manifest file which could be as simple as
Main-Class: <MainClass Name>
Version: 1.0

Put this manifest file inside the JAR so that it runs when double-clicked if that's what you are looking for.

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

@ Nikhil: Wouldn't it be better to check the date before posting. the question was asked almost 5 years ago.

verruckt24 438 Posting Shark

What is the name of the file you have written this code into ? It should be named exactly what the public class in it is named which is ImageDrawingApplet.

The compiler clearly tells you the error and also marks the line in error:

\src\javaapplication19\Main.java:168: class ImageDrawingApplet is public, should be declared in a file named ImageDrawingApplet.java
public class ImageDrawingApplet extends JApplet {

Read and try to look for the errors.

verruckt24 438 Posting Shark

What is the name of the file you have written this code into ? It should be named exactly what the public class in it is named which is ImageDrawingApplet.

The compiler clearly tells you the error and also marks the line in error:
\src\javaapplication19\Main.java:168: class ImageDrawingApplet is public, should be declared in a file named ImageDrawingApplet.java

public class ImageDrawingApplet extends JApplet {

Read and try to look for the errors.

verruckt24 438 Posting Shark

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

verruckt24 438 Posting Shark

It works !!!

verruckt24 438 Posting Shark

My current project needs me to include the facilities of an email client into the system in order to keep track of all communication done through email. Designing an building an email client would be sort of re-inventing the wheel especially since thats not one of the core modules of the system.

What I need here is an open source email client that could be integrated with our system to keep track of & process the mail communication. It should, preferably, provide features that all standard mail clients provide so that our clients do not loose on any of the functions of a standard mail client.

Can anyone suggest a mail client that could be used in this case, if needed we can even buy a license for that.

Thanks.

verruckt24 438 Posting Shark

JButton class inherits the setFont method of the JComponent class, you could use that. Check the API reference.

verruckt24 438 Posting Shark

String objects are immutable and you can always reuse something that is immutable because you know that it isn't going to get modified. When you are writing "String s = new String("hello");", you are creating an unnecessary object; not only that it is also inefficient cause objects creation itself is. Moreover an object created this way cannot be reused. If this statement gets called in a loop or in a method it would unnecessarily create several objects which could all have been represented by a single one. So always use the "String s = "hello";" version instead of the other, this way any other string object with the same string literal can reuse this one.

PS: You seem so intelligent when parotting intelligent people....Here the intelligent person is Joshua Bloch, psst...but let this be sold on my name.

EDIT : Beaten, Peter has pointed out the exact article/item I was mentioning from.

verruckt24 438 Posting Shark

No actually running itself was his problem, since he was using the .java extension to the filename while running.

verruckt24 438 Posting Shark

whats the format inside ur employee.txt??

Whats that gotta do with the "ClassDefNotFound" error in java?

verruckt24 438 Posting Shark

What does your info say ?

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

offending by making fun of my word "SolvedThreads" - musthafa.aj

And where in your post did you use this word could you show us ?

verruckt24 438 Posting Shark

i don't know you pursuing me and put negative marks..
is really giving pleasant to you?
i am ot technical expert...
i learning through by analyzing other problems...
just i asked for "Mark it solved" to know whether i am useful or not...
you may giant in technical but i am not...
what i know that i suggested to others that may helpful or may not be..
so plz make it correct if i done wrong...
otherwise it will not be good always for you...
so be careful before put negative mark as unnecessary...

I am not asking you to be a technical expert, I don't expect you to be, but what we and the OP expects is you not guiding him incorrectly. Whether you do it on purpose or by accident is irrelevant. In this thread I found your advice wrong to which I replied correcting you. That post was down voted by you know who. Here too you seemed to be leading him incorrectly and I tried to advice him the correct way. Again this post was down voted by... you-know-who. You could go back and check on both posts and try to figure out who was the one giving the wrong advice, who was the one correcting the wrong advice and who, if at all, should have been down-voted. But that is ofcourse if you can actually figure out the right from the wrong.

What …

verruckt24 438 Posting Shark

strtokeize with '.' symbol...
so it will be
java is an object oriented language.
it has many feature including 1
.1 robust 1
.2 inheritance.
java is a interesting language.
when you get each string like this..
so you check if else condition to rearrange this statement...

Why not on ". " (period and space character) then ? It would avoid all the trouble for one thing.

plz mark solved previous post String array to object...it will encourage me...

Does seeing your "SolvedThreads" counter go up the only thing that encourages you ? So that you keep on repeating the same thing after almost every post. Whatever happened to the good feeling of having helped someone solve something.

@OP: To split sentences you would need to check for either of the two things. First ". " (period & space character) as mentioned above and then the period and the new line character for sentences starting on new lines or paragraph as these would not be necessarily be having the space character after the period character.

musthafa.aj commented: offending by making fun of my word "SolvedThreads" +0
GeniusLives commented: I agree. +0
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

Or the one I read requiring 15 years of NT4 server administration, in 1996.

When Narue made a statement about 10 years java exp in 1998 I couldn't believe that, I was literally asking myself could that be even true or would she have read the ad incorrectly. But believe my surprise (or shock rather) when just yesterday I saw a company making the ridiculous demand on one of the job portals here where they required an experience in Java/J2EE for 15 years. It is still the start of 2010 and even if do assume that Java was out at the start of 1995 yet still who would be the guyz with a 15 years "hands-on" experience of a langauge that itself is barely 15 years old. C'mon if you need the James Goslings and the Bill Joys why not write to them directly ?

verruckt24 438 Posting Shark

Have you heard about Google ? Cause it certainly must have heard about both the terms, I am sure.

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

If it gets tougher than nothing like it because I've seen a lot of SCJPs who couldn't answer the very basic of the questions. Making it tough enough or even very tough causes very few, only the very deserving ones, pass the exam. This again adds to the value.

So overall that would be a very welcome change.

verruckt24 438 Posting Shark

who cares if people should know about concurrency, synchronisation and other stuff?

Organisations hiring Java professionsals do. Smart people who yearn to write correct programs do.

people can read up when they need it, and forget about it after they are done. and when they need it again, simply use/modify the classes they wrote the previous time. that is the beauty of OO and Java. write and forget.

That isn't so easy at all. It seems to be easy, but it ain't that much.

PS: Somebody please mark this thread as solved before we start discussing Perl, Python & LISP here. ;)

verruckt24 438 Posting Shark

I have been called a stupid poster here , and I wanted to know why ? That's all !!

Just try and understand what he's saying if you can.

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

Yes, but I assume you are talking about the Hello World v2.0 programs those about factorials and prime numbers, because if you are into serious programming, may it be any language then, then it demands that you know a lot about the lanaguage, it's architecture, the internal details, the environment of the program such as the setting it would be running in and so on. I agree Java makes the programmer's life easy by relaxing him of worrying about memory management. It would free your objects for you through the use of garbage collector, but it does require you to know how a garbage collector actually works. What objects a GC would or would not collect, what the GC' good for and for what it isn't. The GC would indeed take care of freeing your objects to which no references are being made, but it still relies on the programmer to null out unrequired references. The GC would also collect all obejcts fallen out of scope but it needs that the objects do fall out of scope sometime after they aren't required, the sooner the better. In a program that creates a lot of objects, objects that do not fall out of scope pretty soon will even lead to memory shortfall causing an OutOfMemory Error. Thats why a programmer needs to know that objects should be declared within minimal scope so that they fall out of scope pretty quickly to be eventually collected by the GC. A programmer needs to …

VilePlecenta commented: Wall of text +0
verruckt24 438 Posting Shark

"Unnecessary crap no one asked you about and no one's impressed by."

I guess you forgot the title to your post.

Salem commented: LOL +19
Ezzaral commented: Sounds about right to me. +10
verruckt24 438 Posting Shark

Java SE is the easiest language; it doesnt bog the programmer down with a heck of a lot of details because its classes handle everything that has got to do with it.

the down side is, the power of Java is limited, but i doubt a new programmer that hasnt even written a "hello world" program is interested to know what the limitations are.

I agree with you but only partially. Java is an easy language to learn as it abstracts away the low-level details like security, memory management etc and the way the runtime environment makes the underlying software/hardware transparent to the programmer also rids him/her of platform specific worries. But having said this there are other languages more easier to learn, one of them being Python.

As for the limitations the only one that comes to my mind is Java isn't good for low-level stuff, like communicating with hardware/devices so you won't find device drivers being written in Java, but here too there is a point to be considered that Java was never written to be that way. Otherwise Java has been able to conquer a lot of peaks, it is everywhere on the client-side with desktop UIs and applets, on the server through daemon services, on the web web with servlets, JSPs, web services, beans etc and it could also be there in your microwave without you knowing it. Performance wise too Java has climbed several notches and it's present day compiler and vms have evolved …

verruckt24 438 Posting Shark

the OP doesn't know how to manually type and search in Google, he needs to be taught that !! Using the script would be again a spoon feeding to him

The OP doesn't know anything as it seems from his posts and don't consider teaching such beings as your primary job else you would be more than busy. Also the 4 lines you wrote including explaining him where the enter key lies on the keyboard is much more than spoon feeding.

And finally my job isn't explaining someone like the OP how to search on google if he is so lame that he can't even do that I'll let him alone, the "let me google that for you" link is to make someone ashamed by showing him how easy it actually is to google for something. I hope you get it. :)

verruckt24 438 Posting Shark

I guess it won't be much of a difference except the certificate would be red in colour instead of blue going by the recent changes that have occurred on sun's site. ;)

verruckt24 438 Posting Shark

step 1: Type http://www.google.co.in/ on your web browser.
step 2: Type i want to become a programmer there and press enter. (Enter key is supposed to be on your keyboard)
step 3: Click on the first 10 links you see there and read them.

I HOPE NOW YOU KNOW WHERE TO START ???

Instead of the trouble of writing all that, takea look at this

verruckt24 438 Posting Shark

Why are you like this ?

Okay let me keep it simple. Google.

verruckt24 438 Posting Shark

i didnt get u

He probably knew you won't.

verruckt24 438 Posting Shark

you will be a lifesaver if you can provide me with this little task

No we won't, Sun has already taken up the task of being the lifesaver of thousands of such people by writing the Java tutorials. Read the tutorials for AWT/Swing and for the various layouts. Now it is on you how much badly you want your life saved.

Also read this thread about we offering help only to those who show effort. If you jump into water which is 3 ft deep and are struggling we won't be throwing you any life jackets you need to stand up on your feet.

verruckt24 438 Posting Shark

Yes apegram has correctly pointed out that you don't seem to have the logic cut out well, do the dry coding make the necessary changes and post again. Elementary mistakes have already been pointed out so correct them as well.

verruckt24 438 Posting Shark

You have put all your method definitions inside one method (main) whereas they should be outside of it. So you put the closing curly brace for main immediately after the main method ends and hence remove the methods from inside the main method.

verruckt24 438 Posting Shark

You have made a lot of syntactical mistakes here.

if (number % i == 0)
	return false;
else
	return true;
if (false);

Do you really think the control will ever reach the line "if (false)" ? Also let's for a moment assume it does, will the control ever enter the statement in the if block ? What do you think are you doing evaluating if (false) ?
By putting a semi-colon immediately after the if condition you are terminating the if block there itself, so the "counter++" statement falls outside the block and is executed irrelevant of the condition in the if block being true or false.

Instead of return false/ return true you should set a flag say NOT_PRIME or COMPOSITE to true when the number is divisible and then exit the loop without checking further using the break keyword.

verruckt24 438 Posting Shark

The very first thread in the forum has answers to your question.

The next time please take a look around and get acquainted before you post such questions.

verruckt24 438 Posting Shark

A constructor is a method that is used to "construct" a new instance of an object. You put various initialization stuff in there such as values that some of your variables should be initialized with. When you are constructing an object you sometimes require that the object shouldn't be constructed with the default values for the instance variables but something other that, something of your choice. To give you an example assume the construction of a Daniweb member, when the member object is constructed it is already alloted with 10 reputation points and not the default 0. So you would implement this as:

class DaniwebMember{
private int reputation;
private int posts;
private string username;
// other stuff 

//parameterized constructor 
public DaniwebMember(){
    reputation = 10;
    posts = 0; // need not do this, since the default is 0 anyway.
    // other init stuff
}

// other methods
}

Constructors can be parametrized or without any parameters. Those that accept parameters are known as parameterized constructors. There could also be multiple constructors for a single class indicating that the object could be initialized in multiple ways. This you can find out if you surf the Java APIs for some classes. If you do not provide a constructor for your class, Java will provide one for you which is known as the default constructor which will obviously not accept any parameters. But if you do provide a parameterized one it won't provide a default non-parameterized one for you. This is because it …

scratchwiz commented: thanks... =) +0
verruckt24 438 Posting Shark

You need to declare the parameterized constructor.

verruckt24 438 Posting Shark

Is this really a true story?

No, it isn't. It is more of an urban legend. Check the link given by jonsca.

verruckt24 438 Posting Shark

>alcay : I want to be programmer
Well C is a good place to start learning. Even C++ is fine. But C++ is considered an extension of the C language and for many reasons it indeed is. So normally tutors, schools, colleges etc do start with C and then move onto C++.
The reason I would prefer C is C++ being an OO language you would be expected to fathom the OO fundamentals along with the basics of programming, now sometimes this may work, learning the OO concepts parallel to programming so that you are brought up into OO paradigm but for someone it might also be a large chunk to chew what with language syntax, constructs, various in-built data types, environment of the language, editors and some programming conventions like naming, indentations etc. there's already so many things to learn while you are starting.
So you start with C and once the seeds of programming & logic-development have been well planted in your mind you could move onto the concepts of OO among others.

Also you would have to start on you own, yes there will be a lot of help in the way but you need to take the first step. There are "Get Me Started" sticky threads on top of every forum so whatever you decide to start with you have the way paved already.

Nick Evan commented: Finally someone with a descent post in this thread. +12
verruckt24 438 Posting Shark

Thats because you have enveloped all your methods in the main, you cannot have the declaration/definition of a method inside a method.

verruckt24 438 Posting Shark

I guess you are not trying to understand here that the suggestions given were for your own good instead you are being offended by that, thats whats wrong. To repeat myself, what BJSJC suggested you is common advice that you would find in every forum's recommeded suggestions and what is repeated here once every now and then. I suggest you read this wonderful essay on how to ask questions the smart way and what you would find out is that BJSJC was just trying to suggest you the same. If someone gives you a suggestion for good, you may as well not take it, it's upto you, but there's no need to come back after that someone, thats what we are calling incorrect attitude, hope you get this.