- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 17
- Posts with Upvotes
- 17
- Upvoting Members
- 14
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
105 Posted Topics
Re: [QUOTE=jazz_vill;1118882] Is there a method in java that lets you find a particular character? then when found increment the counter for that letter. [/QUOTE] Look at the Java API under the String class. There is a method called contains which will check to see if the passed in variable is … | |
Re: [QUOTE=avinash_545;1209279]Hi everyone. I am currently doing small exercises on classes. Suppose you have 2 classes: Person (superclass) and Student (subclass) the class Student is extending the class Person. When creating new objects of type Student, when do use the following options: option 1: student x= new student( ..); option 2;( … | |
Re: No one is going to just give you the code for it, without any effort on your part. Java and C# are very similar so you should have a rough template to understand what is going on. You should try and write some C# code attempting to mymic the functionality … | |
Re: What exactly are you looking for? Are you wanting to create a stored procedure (in the database) and call it from C# code, or are you trying to create a stored procedure in C# and store that in the database? | |
Re: You can look at using SqlConnection and SqlCommand's to do what you want. Simple searches on the web will help you along the way. Or post some code here, describe where you are running into problems and I'm sure people will be happy to give some advice. | |
Re: In addition to what thines said above, if the DoSomething method acts on an object you could mock out the object and see if a particular method was called with a given set of parameters | |
Re: Why not add the program to the startup menu. There are other was of doing it but this would meet your requirements | |
Re: Did you not like the answers in your [URL="http://www.daniweb.com/software-development/csharp/threads/387282"]previous thread[/URL]? | |
Re: What does the stacktrace look like? | |
Re: Do you have Student defined? Is it in the namespace School? | |
Re: I think the problem is caused because you are only drawing (painting) your shapes. You can try to call super.paint() and see if that fixes your problem. However my recomendation would be not to override paint. Insead override the paintComponent method. So you could do something like [CODE] @Override protected … | |
Re: There are a couple options. One is to use clickonce or write your own self updating application that once it starts it checks to see if a new version is released. There is a good overview along with some code for the later [URL="http://www.eggheadcafe.com/articles/pfc/selfupdater.asp"]here[/URL]. There are lots of articles on … | |
Re: It doesn't look like you have put any effort in and are just looking for an easy way out. There are lots of good articles around the internet regarding genetic algorithms. I found [URL="http://www.codeproject.com/KB/recipes/btl_ga.aspx"]this article[/URL] with a simple google search. It should help give you an idea | |
Re: You are going to need to open the file for reading. read all the lines and do some parsing on it. Post what you have so far and people may be more willing to help. ![]() | |
Re: I assume that since this is your first class you will be using the console to read and write your information. A good rule of thumb is anytime you need to repeat a task more than once would be to use a loop. The most common types of loops are … | |
Re: There is a good [URL="http://www.codeproject.com/KB/cs/c__plugin_architecture.aspx"]code project article[/URL] illustrating some of these points. | |
Re: Unfortunately no one here is going to do it for you. But this problem is rather simple when you think about it logically. I assume your teacher has gone over class structure and all that wonderfull stuff. So to start create a new class called fight. Assign some attributes to … | |
Re: Try dropping the word interface on line 10. If you are specifying implements it understand you are going to reference an interface. | |
Re: Look at [URL="http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#sort(java.util.List)"]Collections.Sort[/URL] | |
Re: Read each line and put it in a stack. Once that is done, remove each element from the stack and print it out. | |
Re: You question is unclear, and you have not put in sufficient effort. To get you started look at creating the array with a defined size. [CODE] Object[][] array = new Object[3][5]; [/CODE] The above code will create a 3(rows) x 5(columns) grid that can hold objects. You should be able … | |
Re: As Masijade was saying you need the regular expression to get one (or more spaces). There are multiple places for you to test (and get help) with regex. One of my favorites is [URL="http://gskinner.com/RegExr/"]RegExr[/URL], as it provides a nice graphical approach and helps you visualize. Anyway you are missing your … | |
Re: The NPE happens when an object is null and its trying to be referenced (go figure). The lines do not line up with what you have posted but your error is occurring on line 326 of the TreeEditTest class. Take a look at that line and see what is causing … | |
Re: You could start by getting the values in the text box and doing a compare. If you want more than that you will have to [URL="http://www.daniweb.com/forums/announcement8-2.html"]look here[/URL] | |
Re: Most likely it is an ArrayIndexOutOfBoundsException which is going to be thrown. You initialize the array to be of size 10, then in your later else if statements add one (1) onto it. This would be fine in the first few loops but when you get to loop 9 and … | |
Re: If your window class extends JFrame, you can just call setVisible(true) on it. Which will make it visible in the default location. Also if it is a JFrame and the form class is a JPanel then you can just do the following from Class1: [CODE]getContentPane().add(Class2)[/CODE] If not .... what Kramerd … | |
Re: You only need to pass in a reference to the String array object. [CODE] public class MyClass { public static void readSearch(String[] filelist) { //Do stuff here } } public class OtherClass { public void read() { String[] array = new String[2]; array[0] = "Something"; array[1] = "Other"; MyClass.readSearch(array); } … | |
Re: Add an ActionListener to your button. Then in the action performed method get the AppletContext and call showDocument with the url and the target (_blank, _self...) | |
Re: Where is nrOfColsFin defined? | |
Re: Wow. Thanks Champ for resurrecting an old thread, asking for code. Read the forum rules before posting, conveniently located at the top of your screen. | |
Re: From what you posted, it looks like you are storing the input received from the JOptionPane in a variable called input, then overwrite it on the next call. As kramerd mentioned, if the value of numMonths (which in your posted code you do not assign) is 0 or less, the … | |
Re: [URL="http://tinyurl.com/22mj2ll"]Here you go[/URL] | |
Re: You need to call manager.get(). Both employee and manager are separate instances of Employee. | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Here You Go[/URL] | |
Re: Specify your own comparator. Do the parsing as mentioned in your other thread then return the results of the compare between the two numbers. | |
Re: There are multiple ways of doing that. You can use the split function on a String, or use StringTokenizer | |
Re: Do some reading on [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JOptionPane.html"]JOptionPane[/URL]. The answers are in that article. Next time post your code in code blocks. | |
Re: Java doesn't have a function called "print" however I assume that this is pseudo code. Java is also very similar to c++, so you should have no problem figuring out what is going on. But the output would be (1) 3, 3 (2) 5, 3 <- remember that x is … | |
Re: You could start off by creating a class called Employee. Employee will have first name, last name, sales and expenses as possible attributes. Read through the file and create a new Employee object then put the employee object into some type of list. Have you employee class implement the Comparable … | |
Re: It doesn't look like you are storing enough information to do a "month end balance". You would need to associate a transaction date with each withdraw / deposit. If you have that then do a query for every transaction that happened within a date range. To show it in a … | |
Re: theData is a List. You should just need to call pop() | |
Re: The compiler is telling you that you are missing return statements. What happens if (in isFruit) if left, center, or right contains an invalid answer for example pear? Similar thing with the other statement | |
Re: A quick google search brought up [URL="http://stackoverflow.com/questions/1182849/face-detection-in-java"]this[/URL] | |
Re: Just by looking at the question, why would you want to do recursion for that? It would be much easier just to do in a method using Math.pow and adding the results. | |
Re: Here's a start: <?xml version="1.0" encoding="UTF-8" ?> | |
Re: Take a look at arraycopy in [URL="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html"]System[/URL] | |
Re: [URL="http://www.daniweb.com/forums/thread141776.html"]Look Here[/URL]. Its done with JSP and MySQL but should be a good reference. | |
Re: info is just a integer value contained by the node. So the if statement just checks if the supplied number (info) is less than the current nodes info value |
The End.