4,084 Posted Topics
Re: did you pass command line parameters, or just expect it to 'magically work' no matter what instruction you gave to run the application? | |
Re: look at [URL="http://www.daniweb.com/forums/thread99132.html"]this[/URL] I would recommend not to start with an IDE since their 'utilities' may make it easy to develop, but that doesn't mean it's a better way to learn. if you do want an IDE, check out [URL="http://www.JCreator.com"]JCreator[/URL], it does all you need when you're a starter, but … | |
Re: [QUOTE=lynnajoe;1496147] 1)I am a little confused as to where to put certain code. If I am doing inventory and I need to have an array does it go into a separate class? [/QUOTE] you could, but since you're still learning and grasping at the concepts, I would advise against it, … | |
Re: to quote Barack Obama [QUOTE='Barack Obama']YES WE CAN!!![/QUOTE] but to speak for ourselves: but we won't. by doing so, we would hinder your progress in actually learning java, which would certainly become a huge handicap for you when your finals or job interviews arrive. | |
![]() | Re: here's a nice link on sorting Arrays, could take a look at that while you're on the subject [URL="http://www.leepoint.net/notes-java/data/arrays/70sorting.html"]Sorting arrays[/URL] |
Re: [CODE=Java]public abstract class Person[/CODE] there's your issue. you can not instantiate an abstract class in Java | |
Re: if it's a jFrame you want to show and hide when clicked on a button, add the right events triggered by the button, and call the setVisible(boolean) function. | |
Re: honestly, I have no idea what you mean ... why is it not an array? why doesn't it work in a for loop? since, how I see it, a for loop will be needed in (at least) one step of your work. | |
![]() | Re: or, you just set an extra variable within the [CODE] if (a[i] > maximum) { maximum = a[i]; }[/CODE] like: [CODE] int maxLocation = 0; if (a[i] > maximum) { maximum = a[i]; maxLocation = i; }[/CODE] ![]() |
Re: or, they have to enter something like 5+7 - 8 = , store this input in an array of characters and checking for the first occurance of =. when they 've found this, they can go puzzeling (adding, subtracting, ... ) all before this point. even an indexOf("=") could do … | |
Re: I'm going with ezzaral and masijade on this ... just because the OP gave as an example [Code=Java] name[] = { "P", "H", "I", "L", "L", "I", "P } [/Code] it's fairly possible that his teacher asked him to 'create an array which stores all characters as separate elements'. If … | |
Re: I have a few remarks here .. firstly, you're mistaking javascript for java, which is a completely other language. secondly, you're trying to write standard html within script tags, which won't work for obvious reasons, since it isn't javascript code. you also never declare the variables which you are using. … | |
Re: the problem is you're calling a default constructor, while you didn't create specify one. you did, however, specify this one: [CODE] CustomerLoyaltyRewards(String name, String id, String add, String phone, String date, double voucher, int extra) {... } [/CODE] your compiler will create a default constructor for you, but only if … | |
Re: or you could declare a final variable, which you give a value the first time your loop runs. final variables, once given a value, can never be changed to another value. | |
Re: well ... it sure is nice to see there are still some students willing to put some effort towards their degree ... | |
Re: why do you need a counter? unless I'm mistaken about what you're trying to do, you just need to compare the size of the arrays, not the contents. In which case, you're just fine with checking the .length of the two you need to compare | |
Re: masjiade was referring to this: [CODE]String pick = "select * from synonym where words like =%'"+st+"'";[/CODE] are you sure you don't need to place the % behind the user selected String? | |
Re: if you want to write to a file, you need to use BufferedWriter and FileWriter | |
Re: that's because your class is filled with errors. you are telling the compiler that you are returning an int, both in getOrder() and displayOrders(), but you have no return statement, nor do you have a variable in which you store the value in your main method, or a print in … | |
Re: just read it as String, convert it to an array of chars, or make a new Scanner class in which you define a nextChar() method :) ![]() | |
Re: yes, and quite easily to do, but my advice would be: DON'T just like java itself, jar files are cross platform. if you create an exe, you'll limit your users, since exe files are not platform independant. | |
Re: and to check the technology? considering the fact that this is a 'Java' forum, giving a solution in javascript might not be what the OP was looking for. now ... next to mine and verruckt24's remark, there was another issue with his post, anyone found that one yet? :) (Yeah, … | |
Re: for starters, you set your N to be 0 and you never change this value, so your code will never go through your loop. | |
Re: or, you could try creating a neat app, that floods developing forums with random generated topics demanding for a final year project-topic. millions of whizz-kids-to-be will be in your debt ... | |
Re: [QUOTE=gavriela;1472359] [CODE] int []allGrades = keyboard.nextLine( ); System.out.println ("You entered the grades for " + allGrades.length + " students.") int [] allGrades = new int; [/CODE] [/QUOTE] not sure what you're trying to do here, but it looks to me this 'll blow up in your face. you're declaring an … | |
Re: and what is 'BoundedBag'? most times, trouble in output are not technical problems of your computer, it's just a difference between what a developer should've written, and what he actually wrote. | |
Re: sigh ... sj5536 ... you may want to think about what you're saying.. Limiter: I assume that you want to print an asterisk n times. create an empty String Object, and run a loop, that runs n times. each time you go through the loop, add a '*' to that … | |
Re: I assume you want to compare what you've entered to what you get out of a database. use a jdbc connector to communicate with the database, retreive the data (being a username and a password) out of the database, and use the .equals(Object o) method to compare the values that … | |
Re: if you're trying, what have you tried so far? if you think it should be done with a for loop, write it as such, and see if it does what you want it to do. don't just sit and wait untill we write it for you. | |
Re: you just compare charx to chary. if they're equals => add 1 to number of repeating characters. | |
Re: well, you can add a layout and css (or javascript) code to your html elements, for instance: <ul class="ulClass"> </ul> now you can use this 'ulClass' to link this ul block to css and/or javascript. well, you can use them both, and jQuery is a javascript library, but when it's … | |
Re: maybe you're not setting the values in floor right. if you declare it as an empty two-dimensional array, and never changes the values, it's normal that if you print it, you don't see anything. | |
Re: [QUOTE=Danii;539183]example if (...){ return 0; } else (...){ return 1; } that do they mean? thnaks in advance[/QUOTE] I'd say they mean you'll be getting some errors while compiling this the (...) in this example is only applicable for the if - part [CODE] if(test){ // what to do if … | |
for the moment, I'm working on a project where I have to apply filtering as used on one table (using the jQuery datatables plugin) to a next table (which is using the picnet.table.filter plugin). now, I have been able to retrieve the values used to filter from the original table, … | |
Re: if you wanted to know how to put it in a .exe installer, the answer is: don't. you'll force your users to have a Windows OS installed, which may not always be the case. | |
Re: you've set your variables as being static variables. look into a better usage of Student: create an Student-Object that stores the same data,but uses setters and getters to handle the information you're storing. also, you'd better place the code you've added into the Input() method in your prg1 class. This … | |
Re: or you could assume that, since stuff like this can in a lot of ways be usefull, it has been implemented in Java already. just go and take a look at what [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/util/StringTokenizer.html"]StringTokenizer[/URL] is all about. I'm quite sure it 'll help you do everything you want (except for making … ![]() | |
Re: well ... if what you're trying to do is what I think you're trying, you might want to check on the correct spelling of 'instanceOf'. just changing [CODE] if(vehicles instanceOf SportsCar){ System.out.println("Yes"); } [/CODE] into [CODE] if(vehicles instanceof SportsCar){ System.out.println("Yes"); } [/CODE] might give you just what you want. ![]() | |
Re: back on topic: a decompiler may get you your code back, based on the .class file. for simple programs, the JAD decompiler always worked for me. | |
Re: and every time creating a new instance means after a while you'll have x instances of one object open, while you can only use 1 | |
Re: that is because you are filling the same element over and over again ... you are using [Code="java"] for (k = 1; k < 99; k+=2 ){ odds[i] = k; } [/Code] you are filling odds[i] with k, while (k <= 99) but you don't change the value of i. … | |
Re: [QUOTE=ztini;1458399][CODE] public class Matrix { private static int[][] level = new int[][] { {0, 0 , 0}, {1, 0, 0}, {0, 0, 0}}; public static void findTheOne() { boolean found = false; for (int i = 0; i < level.length; i++) { for (int j = 0; j < level[0].length; … | |
Re: there are different ways, you can also add a package that can play .mp3 's and use that :) for instance the jmf (java media framework) or the framework used in [URL="http://www.javazoom.net/javalayer/javalayer.html"]JavaZoom[/URL]. | |
Re: because you've placed one method within another | |
Re: you may ask us help, yes, but we are not going to write it for you. start with writing down the logical steps (pseudocode or nasi schneiderman) try and write the part that you know how to, and try to code the part you don't completely understand. if you run … | |
Re: and change total *= grade; to total += grade; otherwise you will have quite some 'averages' :) | |
Re: either you must instantiate it, or you must make the class static, but that wouldn't help you much in this case. passing the variable to the class using the setter is the best approach, why would you want to change that? ** Edit, sorry just looked this over fast on … | |
Re: no ... we're actually waiting for you to give us the codes you've written so far and tell us where you're stuck. this is a developer forum, not 'developers-for-hire' | |
Re: in which case you do not remove threads, you edit the posts. a method can not be a boolean, but it can have a boolean as a returnvalue. when a method has a 'void' returnvalue, it means that it does not return anything. if you want it to change a … |
The End.