- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
I'm a student/musician (mainly drums)/tech obsessor.
- Interests
- Music, games, martial arts, fast things
Re: I just wrote this for something else, so here you go. [code=java] public class reverse { public static String reverseIt(String a) { int length = a.length(); StringBuilder reverse = new StringBuilder(); for(int i = length; i > 0; --i) { char result = a.charAt(i-1); reverse.append(result); } return reverse.toString(); } } … | |
Re: There are a couple of problems, the biggest being that you didn't create the method ReverseIt. Also, you had a few syntax errors. Make sure you check everything over thoroughly. [code=java] public class reverse { public static String reverseIt(String a) { int length = a.length(); StringBuilder reverse = new StringBuilder(); … | |
Re: [QUOTE=ganesh5155;943426]hi all i need ur help to solve this problem 1. write an algorithm to find the average of there number called a,b,c 2. write an algorithm to add up all odd numbers between 0 and 100 3. what data type for (i) True ] if data type for 123 … | |
Re: You need to tell us more. Do you want the program to be able to multiply out values for you and store them or do you just want it to be a container for values that you decide? And try to do it first. There are plenty of tutorials out … | |
Re: Identify what the program needs to do very specifically. [LIST] [*]Prompt the user to input a String [*]Separate the String into separate characters [*]Identify the case of each letter [*]Tally up the number of each type of character [*]Ignore the characters that aren't letters [*]Display the final tally [/LIST] Briefly … | |
Re: [url]http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp[/url] There you go. | |
Re: Let's say X is your number. If X is even, then it must be divisible by 2 OR it's equal to zero. If it isn't then it's not even. You would use something along these lines to determine whether or not your number is even. In this, X is the … | |
Re: Here you go. It's a bit rough, but it does what you wanted. The main reason it's tough to understand is because you didn't split all your code into separate methods. If you had defined different things using individual methods and then strung it all together in main then everything … | |
Re: Outline what you need to do first. Raise a few questions and answer them. You need to address a few things: [LIST] [*]Identify which parts of the input string are words and which are not and bypass the ones that are not. [*]Separate each word - how would you identify … | |
Re: From the Sun website: [QUOTE] sort public static <T> void sort(T[] a, Comparator<? super T> c) Sorts the specified array of objects according to the order induced by the specified comparator. All elements in the array must be mutually comparable by the specified comparator (that is, c.compare(e1, e2) must not … | |
Re: If you're just learning it and have no real programming experience beforehand then of course it's difficult. | |
Hi all, I'm a student learning Java right now, so I'm still very new to what Java can do. I've written a program to perform a word count (thanks to VernonDozier for help with case-sensitivity) but another problem has come up. The program is identifying words with punctuation to be … | |
Hi all, I'm currently learning Java right now through a class and my instructor has asked me to try writing a word-count program using a Map interface. It should run through command line and has to identify the number of words, the number of distinct words, and the distinct words … | |
Re: [QUOTE=Web_Sailor;933901] //Then I am setting the value of mystring in other method like this:- public void Method2(){ Class1 wow = new Class1(); wow.mymethod(); wow.mystring = somevalueInThisMethod; } } [/QUOTE] Well, you've created three methods. The first method, "mymethod", is relatively useless. You could declare and initialize mystring straight from the … |