Results 1 to 10 of 10
Thread: basic java
- 06-28-2012, 03:12 PM #1
Member
- Join Date
- Jun 2012
- Posts
- 3
- Rep Power
- 0
- 06-28-2012, 03:16 PM #2
Re: basic java
What have you tried? You should know the type of a variable, since you have to specify that. Do you mean something else?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-28-2012, 04:25 PM #3
Member
- Join Date
- Jun 2012
- Posts
- 22
- Rep Power
- 0
Re: basic java
- 06-28-2012, 08:58 PM #4
Re: basic java
Please go through the Forum Rules -- particularly the third paragraph.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 06-29-2012, 08:03 AM #5
Banned
- Join Date
- Jun 2012
- Location
- Beijing,China
- Posts
- 34
- Rep Power
- 0
Re: basic java
How about:
Java Code:public class x{ public static void main(String [] args) { String x="3245 "; if (x.equals(x.replaceAll("\\D"," ")) ) System.out.println(x +" is Numeric"); else System.out.println(x+"is Character"); } }
KsharpLast edited by Ksharp; 06-29-2012 at 08:06 AM.
- 06-29-2012, 01:25 PM #6
Re: basic java
Spoonfeeding is NOT helping. Spoonfeeding crappy code is actually harmful. I appreciate that you're trying to help, but that's NOT helping.
This is probably for a programming homework assignment where the point of the assignment was to do some research, try some things out, work on problem solving. Problem solving is incredibly important to programming, and it's really hard to teach (and learn) other than by working through assignments. You just took away the "a-ha!" moment that's so important to that process. Even if the OP uses your code, what happens during a test? Or during the next assignment that builds on the lessons learned here?
Just something to keep in mind when you help in the future...How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-29-2012, 02:49 PM #7
Member
- Join Date
- Jun 2012
- Posts
- 3
- Rep Power
- 0
Re: basic java
thanq
- 06-29-2012, 03:32 PM #8
Banned
- Join Date
- Jun 2012
- Location
- Beijing,China
- Posts
- 34
- Rep Power
- 0
Re: basic java
What's matter with you ? Even My code is crap , That is also not your bussiness.
If you think it is laughable ,go away . I don't need any words from you.
- 06-29-2012, 03:45 PM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: basic java
The forum has a rule that we don't spoon feed answers, as that's not considered constructive since they most often occur for people who are trying to learn the language or complete some academic problem. It's the old case of teaching someone to fish rather than giving them a fish.
Your code would work if you didn't replace the spaces, at least for integers.
I don't consider a String containing spaces as a valid integer.Please do not ask for code as refusal often offends.
- 06-30-2012, 11:55 AM #10
Re: basic java
So, you think you know better than Kevin? You can see he has than 2,000 posts on this forum; he also has several thousand more on other forums, but you're not expected to know that, and is a community moderator on at least 2 Java forums, but you're not expected to know that either.
I repeat what Kevin has said: Spoonfeeding is NOT helping. Spoonfeeding crappy code is actually harmful.
I'll also add that members who have refused to accept moderator advice in this regard and who have obstinately continued to spoonfeed crappy code have been banned. If you don't take this seriously, you're headed the same way.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
[ASK] Need help about java basic T_T
By shezars in forum New To JavaReplies: 5Last Post: 03-09-2012, 04:22 AM -
Java Basic
By Anveshan in forum New To JavaReplies: 6Last Post: 05-06-2011, 09:45 AM -
Basic java
By santa in forum New To JavaReplies: 5Last Post: 11-16-2009, 10:16 AM -
basic java
By vijay24805 in forum New To JavaReplies: 25Last Post: 04-14-2009, 02:46 AM -
basic java help
By adred in forum New To JavaReplies: 0Last Post: 03-08-2008, 12:36 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks