713 Posted Topics

Member Avatar for Sunshineserene

There are a few possible problems I can imagine here, but I don't know which one it'll be without seeing the code. One is something like this: [CODE] public class ThisClass { public static int intArray[3]; public boolead theMoonIsMadeofGreenCheese = true; public static void main (String[] args) { while (theMoonIsMadeOfGreenCheese) …

Member Avatar for Sunshineserene
0
817
Member Avatar for Garee

What skills do you want to work on? What sorts of things have you done so far? There are a lot of possibilities. Conway Life is a pretty good place to play: easy to get into and pretty open-ended. You can add a lot of features, you can tart up …

Member Avatar for new_programmer
0
831
Member Avatar for NewOrder

[QUOTE] System.out.println(Car.getCounter());// why to put this statement again after the variable cars was defined to be null?[/QUOTE] The variable cars points to an array of objects, each member of that array is an object of type Car. That array might contain, for example, Ram's Tata Nano and Guiseppe's Fiat and …

Member Avatar for NewOrder
0
237
Member Avatar for prem2

Prem - you need to understand what static means, to start with. "Static" means "relating to the class, not to an object". A static field of a class is a value associated with the class, and not to any object of that class. An instance field is a property of …

Member Avatar for jon.kiparsky
0
1K
Member Avatar for ueoptimum

Put the body of your if statements in curly braces. [CODE] if(al >= 10001) ir = .075; // this line is the only one in the if i = al*ir*nmp; // this always executes ma = ad/nmp; // so does this else if ((al < 10000) && (al >= 6001)) …

Member Avatar for javaAddict
0
136
Member Avatar for keanoppy

Norm - he's using the punctuation as a delimiter. He's actually getting three tokens, as you'll see if you run the code. (put in a counter if you don't believe me!) So the problem is, how do you remove a specified substring from a String. There are a few ways …

Member Avatar for keanoppy
0
258
Member Avatar for Garee

First of all, I couldn't see any reason why you wouldn't get values assigned, so I ran this (the only changes I made were to make keyboard an instance of Scanner and to add an iteration at the end to print out the values). It assigned seven values for seven …

Member Avatar for jon.kiparsky
0
114
Member Avatar for merlin1106

This is not a mortgage calculator with a GUI, this is a GUI that calculates mortgages. Consider yourself grumbled at. Now, it doesn't calculate, you say? [CODE]private void getCleanScreen() { throw new UnsupportedOperationException("Not yet implemented"); } private double getFigure(double mortgagefigure) { throw new UnsupportedOperationException("Not yet implemented"); } private double getPayment(double …

Member Avatar for jon.kiparsky
0
407
Member Avatar for Xufyan

One problem I see is that you're trying to initialize a String with a char value in line 12. Single quotes ('') enclose a char, double quotes("") enclose a String. The rest of your error messages aren't making immediate sense to me, but try fixing that and see what happens.

Member Avatar for Xufyan
0
260
Member Avatar for JamesCherrill
Member Avatar for Sugarskull

I didn't even have to count lines - I just looked for the line with the ridiculous number of parentheses, and there's the problem. udscrick - For each '(' you need an ')'. Work your way out from the center of the expression - the first thing that's evaluated - …

Member Avatar for Ezzaral
0
276
Member Avatar for new_programmer

If you read up on "Generics" - just search on "java generics" - you'll learn an awful lot about this syntax and why it was added to the language.

Member Avatar for vhoramoin
0
137
Member Avatar for Hawkpath

This is a pretty difficult problem, actually. The applet security model is based on the applet running in total isolation, so it can't really communicate with the world. There is a way to do it, but it's very clunky and really a last-ditch solution. I understand that servlets offer some …

Member Avatar for NormR1
0
449
Member Avatar for jon.kiparsky

Anyone played with the jxl API before? It's a tool for read/write access to Excel spreadsheets - a little bit dodgy, but it works. I wrote a piece of code for my brother using this a few months ago, and now he's starting to see a warning message, which is …

0
160
Member Avatar for jemz

You're referring to a class called Node, but the compiler can't find it. Do you have that class defined somewhere? Maybe in a class called Node.java? Good to see you're working on linked lists, by the way. Data structures are fun.

Member Avatar for jemz
0
6K
Member Avatar for samehere

What do you want to know about inventory management programs in java? If you just want to know "about" them, there's always google.

Member Avatar for jon.kiparsky
0
118
Member Avatar for piyushgt
Member Avatar for scrappedcola
0
72
Member Avatar for backendcode

Learn both. Python is a breeze to learn, once you get used to the significant whitespace (I had horrible flashbacks to vicous and invisible bugs in makefiles, but it's actually okay). Perl is obnoxious and lovely and lots of fun. Python scales up better - you do't really hear about …

Member Avatar for jon.kiparsky
0
88
Member Avatar for new_divine

I'm having a hard time understanding what you want to do, in detail, but it does sound like a complex problem any way I try to understand it. Are you trying to do something to find a bus route from point A to point B? (ie, I'm at 3 Main …

Member Avatar for jon.kiparsky
0
337
Member Avatar for java..

An interface is a contract between you and the compiler. The compiler will allow that your class will stand in for an X if you implement the X interface and provide all of the methods that interface demands. An abstract class is an actual class which you can extend, but …

Member Avatar for jon.kiparsky
0
217
Member Avatar for nocookies92

You need another set of curly braces surrounding the whole mess. Like so: [CODE= Java] public class Lists { static String[][] la = {{"a", "n", "s"}, {"1","2","3"}}; public static void main (String[]args) { for (String[] sa:la) for (String s:sa) System.out.println(s); } } [/CODE]

Member Avatar for nocookies92
0
132
Member Avatar for priyanca

a) We have no idea what sort of work you've done or what you're interested in doing b) We have no idea of what level of project you're looking for, or what sort of time commitment you're looking to set c) If you're pursuing a degree, coming up with a …

Member Avatar for tong1
-1
343
Member Avatar for happygeek
Member Avatar for Dom Chester

Good books... Dunno, but Lewis and Loftus was a reasonably good intro, covered the basics pretty well, and folded in the graphics part well. Very weak on the theory, but you'll want to get that later anyway. Switch is a language construct, derived from C and probably earlier languages, which …

Member Avatar for tizon
0
98
Member Avatar for kunalsankpal

Perhaps you should write it in a language you know, then. (You are free to use a programming language of your choice, after all)

Member Avatar for kunalsankpal
0
113
Member Avatar for extemer

Pick one, it doesn't matter which, and be good at it. Once you've managed that, pick up the other, it won't be hard if you've really understood the first. Write lots of code, and you'll find that learning new languages is not terribly difficult. Using them might be - if …

Member Avatar for new_programmer
0
112
Member Avatar for enazi

If you're using the console, you're on the right track. Your only trouble is that the Scanner.next() method only seems to grab non-null input followed by a return. Just the return won't do it. Try Scanner.nextLine() Tong's solution is worth understanding when you get into a GUI, but it looks …

Member Avatar for enazi
0
2K
Member Avatar for Perlhelp

There's a lot of literature on the limitations of floating-point arithmetic (google "floating point arithmetic" for a sample) so I won't try to replicate what smart people have already said well, but if you read down some of the stuff that's been written you'll get a pretty good idea. The …

Member Avatar for jon.kiparsky
0
75
Member Avatar for nocookies92

This certainly should work, there's no errors I can find and it compiles okay here. "Illegal start of type" suggests that there may be a problem in the boilerplate. Check to see that you have the closing square bracket on your main() declaration: [CODE] public static void main(String args[]) // …

Member Avatar for nocookies92
0
124
Member Avatar for new_programmer

I'll take a stab at this, hoping that any errors or omissions will be remedied by other members. Final simply means that once the variable is assigned, it may not be reassigned. That is, it is a constant. This is useful for two reasons. The first is performance: the compiler …

Member Avatar for masijade
0
427
Member Avatar for Anand111
Member Avatar for mayursharma

So you want to parse an infix expression? This can get complex. For example, the expression you've given, 12+3*5-7 has to be done as 12+ (3*5) - 7 for the correct result. Order of operations gets tricky. But for your first step, you want to scan the input. The easiest …

Member Avatar for jon.kiparsky
0
173
Member Avatar for Xufyan
Member Avatar for gor.irina

...or based on the second column if you want the columns to be right justified. What sort of input does gnuplot want? Fixed-width, delimited?

Member Avatar for java_programmer
0
137
Member Avatar for dylgod

Okay, you're not really calling any of those methods except the getInput one, and that's kind of weird. In the input, you want to set choice to something (right now, you're reading into input and then overwriting it immediately). Once you have an input and a choice, you want to …

Member Avatar for jon.kiparsky
0
121
Member Avatar for dck133

I don't see the multidimensional part. This looks like you're talking about an array of Item objects, where an Item has, let me guess, String name, int stockNumber, double price, int qty? Whatever it is, an Item can be put in an ArrayList<Item>, which will expand as you need. Or …

Member Avatar for JamesCherrill
0
126
Member Avatar for jemz

You can get any of the characters in the string with String.charAt(), so all you need is to generate lists of integers. The lists should use each of the integers (0..length-1) exactly one time. So you need a method that returns a randomly shuffled list of integers from (0..n). You …

Member Avatar for jemz
0
1K
Member Avatar for JamesPH

Yes, that's much clearer, and the compressed style should be avoided. However, the posted code should compile and run in Java. Was there some sort of question about it?

Member Avatar for JamesPH
0
82
Member Avatar for ben1

It doesn't look like your main() method is doing anything. Is this an omission, or is this the actual code? If this is the actual code, try putting a call to the printLoop method in the main method and see what happens. (I assume from the presence of the main() …

Member Avatar for ben1
0
130
Member Avatar for har58

Har To save the repeated checking, you might try one of these methods: 1) Make an array of booleans and mark them "true" as you draw them. Generate a random integer, and check it against the list before you use it. 2) ArrayList can store Objects, which can be removed …

Member Avatar for tong1
0
175
Member Avatar for newperlniu

Okay, this is not a great suggestion but if I had to do this TONIGHT and couldn't wait for a better idea, I'd try joining each file into one long string (with some separator, like, oh, newline or something) and putting them into an array of scalars. Then when you …

Member Avatar for balamurugan_g
0
3K
Member Avatar for vaultdweller123

I used to be superstitious, but I heard it was bad luck, so I gave it up.

Member Avatar for dellie
0
309
Member Avatar for glamourhits

There are two loop structures that you can use in Java, the while and the for loop. Do you know how to use these? If not, you should probably consult one of the 1.2 bazillion references that are available on the web, some of which are mentioned at the top …

Member Avatar for glamourhits
0
217
Member Avatar for diyez treze

Okay, you want it to handle decimals. You can read a decimal, right? You can take the string "123.456" and parse it into a double? Okay, you could read that in a couple of different ways, but the easiest is "one hundred twenty three point four five six." So take …

Member Avatar for jon.kiparsky
0
143
Member Avatar for hazeeel

String.split() returns an array of Strings, and you know the indexes that you want to save (6-8). So there's at least one simple way to do it: make your new array of String[3] and walk through it, putting the first value in the first slot, the second value in the …

Member Avatar for hazeeel
0
100
Member Avatar for pi_lord12
Member Avatar for cjmartin

So the value returned by getItemCount is the data from the scanner? It's hard to see in all this, but maybe that's the case. If so, it's an int, there's no carriage return there. That suggests to me that the value from the scanner is processed elsewhere, most likely in …

Member Avatar for cjmartin
0
110
Member Avatar for NewOrder

dec /= 16; is equivalent to dec = dec/16; This is a standard short form for arithmetic operators.

Member Avatar for NewOrder
0
115
Member Avatar for jemz

pal seems to mean two different things here. Review the initializations and the input portion of the program, and see if you can clear that up.

Member Avatar for jemz
0
387
Member Avatar for comSysStudent

The unary ++ operator comes in preincrement and postincrement flavors. You used (as you noticed) the postincrement version, which does the ++ after it reads the variable. j=i++; is equivalent to j=i; i+=1; If you did a preincrement, you would indeed start from 1. The preincrement operator is like this: …

Member Avatar for comSysStudent
0
102

The End.