Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #4K
~15.9K People Reached
Favorite Forums
Favorite Tags
java x 84

58 Posted Topics

Member Avatar for Babyblues

You should havesomething like: if ( number % 2 == 0 ){ // The number is EVEN } else // the number is ODD } number % 2 - will result in 0 if the number is divisable (has no remainder) by 2 Modulas operations return any remainder of the …

Member Avatar for stultuske
0
202
Member Avatar for Maureen

AS Narue says, use get/set judiciously. The greatest power of Java (and any OO programming language that is,) is the ability to 'encapsulate' data (members) to better control how to use that data. A good example in your above code is if you wish to make the course member 'read-only' …

Member Avatar for manjushreekaran
0
3K
Member Avatar for Kronk Vaesir

Class variables (members) automatically initilize to a default value. Method variables do not. You did not set a value for 'number' when decalred in your 'main' method. Even though you do set it in the 'for' loop, the compiler assumes that you could possibly never enter the loop. Since this …

Member Avatar for Ezzaral
0
3K
Member Avatar for George2

Here is a document you might also want to read: [url]http://www.javaworld.com/javaworld/jw-04-1996/jw-04-synch.html[/url]

Member Avatar for anand.g
0
184
Member Avatar for popi

See: [url]http://www.javaworld.com/javaworld/jw-10-1998/jw-10-toolbox-p2.html[/url]

Member Avatar for d_bibhu
0
67
Member Avatar for Rentro

Look at the String documentation at: [url]http://java.sun.com/j2se/1.4.2/docs/api/index.html[/url] specifically at the substring method

Member Avatar for Parsu7
0
210
Member Avatar for George2

Is this for a mobile device? The library you downloaded is: [b] Micro Edition[/b] Mobile Media API Reference Implementation Version 1.0 (MMAPI) You may be experiancing problems because you are trying to run the app as a PC app, and the library is not designed for the PC environment. Hence …

Member Avatar for George2
1
311
Member Avatar for smartdetect

Two things. One, show us first what you have. Then we can assist in helping you Two, this forum is for assistance, not free code. If you want to learn how to do it in Java, show some effort first. I work for a living and do research accordingly. I …

Member Avatar for freesoft_2000
0
149
Member Avatar for freesoft_2000

You can also look here for some help: [url]http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html?[/url]

Member Avatar for tigerxx
0
207
Member Avatar for BrownSuga

First glance is you defined a constructor with a parameter. If you define a constructor with a parameter, you also need to define the default constructor.

Member Avatar for jerbo
0
107
Member Avatar for jerbo

Here is a good tutorial link: [url]http://www.javaworld.com/javaworld/jw-05-2002/jw-0503-java101_p.html[/url] As a matter of fact: [url]http://www.javaworld.com/[/url] Has some excellent articals.

Member Avatar for jwenting
0
86
Member Avatar for jdl44lfhs

Take a stab at it first, then post what you have. It's easy to do the work for you, but then what would you learn from it? If you are interested in code, then check out something like: [url]http://www.planet-source-code.com/[/url]

Member Avatar for jdl44lfhs
0
209
Member Avatar for nanosani

I did a search, and found: [url]http://www.diamondedge.com/[/url] Also [url]http://www.blackdirt.com/[/url] and [url]http://www.vb2java.com/vb2java.html[/url]

Member Avatar for jerbo
0
146
Member Avatar for warm heart

It also helps to state the problem that you are having. Just saying HELP gives me no clue as to the problem you are having. I can infer somewhat from your statement above, but my determination is you want to know how to read input and place it into the …

Member Avatar for jerbo
0
106
Member Avatar for Vinay
Member Avatar for ultimate_fusion

Actually in a program (application) you will only have one main method. All others are just classes (with no main method). Same as in VB, you only have one 'Sub Main' routine.

Member Avatar for jerbo
0
110
Member Avatar for fulmont99

In both methods: char crypt char decrypt You specify a char return type, but you are returning an char array type char[] crypt char[] decrypt

Member Avatar for fulmont99
0
163
Member Avatar for dncloud

Actually the above will not work. You need to look at the .equals and the .toUpper, or .toLower methods for a String. This should get you going in the right direction.

Member Avatar for jwenting
0
136
Member Avatar for alanna

Please clarify by what you mean by 'what type of poker hand it is'? Are you refering to the type of hand (i.e. Straight, flush, full house, ... ) ?

Member Avatar for alanna
0
196
Member Avatar for vyk2rr

Speeking of language, I think this is a JAVA language too. To all parties, just let vyk2rr, make his post now, in english please and be done with it. Yes, it can be said that we all need to learn about other cultures. Being retired military, I have seen other …

Member Avatar for alc6379
0
181
Member Avatar for ultimate_fusion

It is a matter of scope. Put [code]int number = 1[/code] outside the Main method (at the begining of your class.) Look up the deffinition of scope in Java to learn more

Member Avatar for ultimate_fusion
0
146
Member Avatar for rick4324528

You use DOT notation (much like you do in VB I think.) [COLOR=Red]ClassInstanceName[/COLOR].[COLOR=DarkOrange]MethodName(Optional parameters)[/COLOR] So if you have: [CODE] String myString = "Something"; // Then you could say: System.out.println( [COLOR=Red]myString[/COLOR].[COLOR=DarkOrange]toUpper()[/COLOR] ); [/CODE] '.toUpper' is a method of the String class that will output the string in upper case. :cool:

Member Avatar for jerbo
0
104
Member Avatar for ancibit

I imported your code, and the only errors I received when run is an index out of bounds error, (when I clicked one of the buttons,) but that was because you have no values for; public final String[] PolyIC = {/*stuff*/}; public final String[] PolyIN = {/*stuff*/}; public final String[] …

Member Avatar for ancibit
0
138
Member Avatar for murphyshane

You also need to enclose it in a try/catch block [code] try { int vals[] = new int [12]; vals[18] = 10; } catch (ArrayIndexOutofBoundsException) { //handle error } [/code] Note - since you create the vals[] array in the try/catch block the vals[] array will not be available after …

Member Avatar for jerbo
0
97
Member Avatar for Ghost
Member Avatar for jerbo
0
89
Member Avatar for hayesmark

Which question? I see 9 questions. Answer the ones you know, and we MAY be able to help with the rest. However, this forum is not for you to submit your homework assignments for us to do. You should at the very least try to answer them yourself first.

Member Avatar for MrScruff
0
185
Member Avatar for agtmulder17

I assume you are wanting to take the value from 'stdin' and build your query? Then: [code] ResultSet query = stat.executeQuery("SELECT * FROM Grade_Report"); [/code] becomes [code] // First create a String to hold your query at the begining of your code String sqlQuery; // Now either after you read …

Member Avatar for jerbo
0
112
Member Avatar for matt_5104

public Calculator getCalculator() { return calc; } You never declare what 'calc' is. public Calculator getCalculator() { Calculator calc; return calc; } However I would assume that you would assign something to 'calc'?

Member Avatar for jerbo
0
140
Member Avatar for server_crash

OK, I think I found your problem. Change String getFile = chooser.getName(); to String getFile = chooser.getSelectedFile().getPath(); The reason you received a Null Pointer exception is FileReader filegetter = new FileReader(getFile); returns the name of the file. However getFile only contains the name of the file, not where to get …

Member Avatar for server_crash
0
144
Member Avatar for ld834

1. Open file 2. Read line 3. Save values (Name ;Magnitude) 4. Save Name to save variable (saveName) 5. Create Array 6. Store values in array 7. Begin loop 8. Read file 7. If end of file clean up and close 9. If Name == saveName Store values in array …

Member Avatar for ld834
0
102
Member Avatar for Dounia

Just taking a quick stab at it, but: Record c; Record r = c.copy(); should be: Record c = new Record(); Record r = c.copy(); This will initilize c to a new Record instance.

Member Avatar for Dounia
0
169
Member Avatar for Eclipse

You want to set up a loop. Save your initial 'P' value, then feed it back into the equation. Then check the result and determine if it is stable or Extinct. You can put the below in it's own method called 'Malthusian': [code] public int Malthusian { double saveP; double …

Member Avatar for jerbo
0
159
Member Avatar for billfrost
Member Avatar for billfrost
0
95
Member Avatar for matt_5104

Hummm, you want an answer without posting any code? Like fixing your car when you left it at home....... :)

Member Avatar for tozaheer
0
126
Member Avatar for psylocke

In order for use to help you, we need to see your code. As has been stated a number of times, this forum is for helping with Java codeing......not doing your work for you.

Member Avatar for jerbo
0
99
Member Avatar for Maria5683

Not sure what you mean by "Put it alltogether" But in simple terms, each class will go into its own file (with the name of the file the same as the Class name.) So your Student class will be Student.java, Your InsyStudent class will be InsyStudent.java. The only other thing …

Member Avatar for jerbo
0
187
Member Avatar for Darkfoxx

Try looking at this thread: [url]http://www.daniweb.com/techtalkforums/thread10700.html[/url] It was talking about converting total seconds into H:M:S

Member Avatar for Phaelax
0
110
Member Avatar for skygod

In your code: ... if ( denomerator % factor == 0) { int newdenomerator = ( denomerator / numerator ); } ... You delcare 'newdenomerator' within your if statement (it is declared between the { and } ). Anything declared between brackets ({,}) has its scope only in the brackets. …

Member Avatar for jerbo
0
977
Member Avatar for jasmin_java

Well, for one you have a function: private TextField setEditable(boolean b) { return null; } And you use it in your init method as such: display = setEditable(false);// add(display); SO this tells me that you set TextField 'display' to NULL, then try to add it to your display TextField. I …

Member Avatar for jerbo
0
291
Member Avatar for PeterX

One thing that I can think of. If you declare a constructor with parameters (and overloaded constructor,) like you did above, you also need to declare the default constructor (with no parameters.) public Salary() { // Default init process } If not then your compiler will complain.

Member Avatar for jerbo
0
69
Member Avatar for femmegirl

Well, every Java Application that is executed (from a command console, or DOS prompt,) should have a 'main' method public void main ( String[] args) { // Your main method }

Member Avatar for femmegirl
0
154
Member Avatar for chungaroo

First question is what is your 'EasyReader' class? Can you post the code for it? I suspect the return from "passwordattempt = console.readLine();" is corrupt, but since console is from the 'EasyReader' class I can't tell.

Member Avatar for jerbo
0
116
Member Avatar for javaLearner

Taken from the Java in a Nutshell try { // Normally this code runs from the top of the block to the bottom // without problems. But it can sometimes throw and exception, // either directly or with a throw statement or intdirectly by calling // a method that throws …

Member Avatar for javaLearner
0
137
Member Avatar for calvinnhobbes47
Member Avatar for jerbo
0
99
Member Avatar for SonicSlayer

To solve the problem with not looping to ask for a new input, you need to include the entire Dialog, Switch statements in a Do-while loop too. In essance your main app, only asks for input once, and then processes the switch statment, and then exits the program.

Member Avatar for SonicSlayer
0
149
Member Avatar for Ghost

A constructor in essance is a method (with the same name as the Class) that is executed when an instance of the class is created. For Example: public class foo { public int x; // Constructor public foo() { // Do something like this.x = 45; } } So when …

Member Avatar for Ghost
0
88
Member Avatar for KCC1982

Where is your Dataset() method defined? Are you including this class on your floppy? I ask because I don't see it (Dataset) defined, or included in your code above. I assume you are compiling on a different PC?

Member Avatar for cosi
0
198
Member Avatar for BrownSuga

As a general rule, Class primitive type variables are automatically initialized to a default value. However if the variable is declared in a method (as in your case,) the value must be initialized prior to use. Even though you set the price to a value, they are all done within …

Member Avatar for BrownSuga
0
112
Member Avatar for grifflyn
Member Avatar for server_crash
0
235
Member Avatar for joebanks

You are creating the array in your main routine: public Assn1() { //initialize data members myCDs = new CD[5]; //provide a dimension for the array ...... By doing this the scope of the array is only visible within the main routine. I think you need to create this as a …

Member Avatar for joebanks
0
155

The End.