Results 1 to 13 of 13
Thread: Error
- 06-25-2009, 10:50 PM #1
Error
Hi Eranda
I compiled this but I have error
I am new to this cite
Can you help me I wonna to much learn Java programing
I use Netbeans 6.5.1
Thanks so much
public class MyQuizTwo {
public static void main(String[] args) {
if("String".trim() == "String".trim())
System.out.println("Yes");
else
System.out.println("No");
}
}Last edited by ulk27; 06-25-2009 at 11:09 PM.
- 06-26-2009, 01:28 AM #2
- 06-26-2009, 04:17 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Few things to clarify here first of all.
1. Please don't interact with others thread, if your question is not related with it. Simply you can start a new thread, with a well explain title about your question. We have well categorized sub-forums here.
2. Please read our FAQ page. It's really helpful to you. You can find the FAQ page on top of the page, in main menu, or in my signature.
3. When you sending your questions next time, try to provide more details you can. Like a code segment in your application, errors if any and so on. The reason is that most people just looking into your code and try to solve it without compile and run the code.
I'll explain what's going on your code in next post. Good luck :)
- 06-26-2009, 04:20 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 06-26-2009, 07:18 PM #5
equals method
When working with strings, you should use the .equals() method when comparing strings:
String (Java Platform SE 6))
Luck,Java Code:String myString = "myString"; String anotherString = "anotherString"; if (myString.equals(anotherString)) ....
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 06-26-2009, 10:32 PM #6
@eranga: cool, you can spawn off post now, is that new feature?
@christ: This came from quiztime, its suppose to be ==.USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 06-27-2009, 05:28 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 06-27-2009, 05:29 PM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 06-28-2009, 11:09 PM #9
hi I post the error mesage
run:
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - main(java.lang.String[]) is already defined in javaapplication1.Main
at javaapplication1.Main.<clinit>(Main.java:29)
Could not find the main class: javaapplication1.Main. Program will exit.
Exception in thread "main"
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
- 06-28-2009, 11:20 PM #10
hi
İf anybody wonna help me
thank so much
- 06-28-2009, 11:24 PM #11
hi
Sorry for me bad english
but I progress my english
every day
- 06-28-2009, 11:33 PM #12
you are using netbeans?
That could be an IDE problem, try starting a new project and run the code. Or even better, compile and run it in CMD.USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 06-29-2009, 04:23 AM #13
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Code segment you've posted in the your question don't have any problems at all. Is that the complete code you have in that java file? Can you post the complete code to see. May be you've define the main method twice in your Java class.
Similar Threads
-
Diference Between compiler error Garbage collection and Runtime Error?
By makpandian in forum New To JavaReplies: 3Last Post: 01-23-2009, 08:53 AM -
error 530 error authentication required
By rgale in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-12-2008, 04:28 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks