| | |
solve.java
![]() |
public class solve{
public static void main (String []args){
A cs = new A();
int first=34;
int second=4;
System.out.println("Sum:" + cs.add(first,second));
System.out.println("Difference:" + cs.subtract(first,second));
}
}
i got this code, unfortunately it refuses to run.. please help..
Something is wrong with "A", dnt know what it is...
public static void main (String []args){
A cs = new A();
int first=34;
int second=4;
System.out.println("Sum:" + cs.add(first,second));
System.out.println("Difference:" + cs.subtract(first,second));
}
}
i got this code, unfortunately it refuses to run.. please help..
Something is wrong with "A", dnt know what it is...
What is "A"? You are trying to create an object of type "A", but from the code you have posted, no such class exists...
im not really good in making classes.. some gave this to me but i don't fully understand...
this is the code i guess...
public class Greeting{
private String Salutation;
Greeting (String s){
Salutation = s;
}
public void greet (String whom){
System.out.println (Salutation + " " + whom);
}
}
together with this one...
public class TestGreeting{
public static void main (String[] args){
Greeting Hello = new Greeting ("Hello");
Hello.greet ("World!");
}
}
please help me on this... tnx...
this is the code i guess...
public class Greeting{
private String Salutation;
Greeting (String s){
Salutation = s;
}
public void greet (String whom){
System.out.println (Salutation + " " + whom);
}
}
together with this one...
public class TestGreeting{
public static void main (String[] args){
Greeting Hello = new Greeting ("Hello");
Hello.greet ("World!");
}
}
please help me on this... tnx...
Last edited by raija09; Dec 15th, 2008 at 1:40 am.
Is there a problem with that second example?
It looks unrelated to your original post, what exactly do you need me to help you with?
It looks unrelated to your original post, what exactly do you need me to help you with?
•
•
•
•
i got this code, unfortunately it refuses to run.. please help..
Something is wrong with "A", dnt know what it is...
•
•
•
•
im not really good in making classes.. some gave this to me but i don't fully understand...
this is the code i guess...
If you are not good at creating classes, I recommend you purchase a good book like "Head First Java" or something similar which till teach you object oriented programming along with Java.
Also the "Starting Java" thread at the top as the name suggests has been created specifically for users like yourself who are just begining to do programming.
Also asking questions like the one above and asking us to fix it will only make you more dependent on others to get your work done and if you intend making a career in this field, I am pretty sure you do not want that.
Last edited by stephen84s; Dec 15th, 2008 at 3:35 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
![]() |
Similar Threads
- Java assessment tests (Java)
- QA Automation Lead Engineer (Regression, JAVA, C/C++) in Replay Solutions Inc. (Software Development Job Offers)
- Sr. Core JAVA Technologist / Software Tool Engineer in Replay Solutions (Software Development Job Offers)
- I got error while i am trying to use java generic classes in jsp (JSP)
- Java Exception (Java)
- Java Software Engineer (Software Development Job Offers)
- Java Software Engineer (Software Development Job Offers)
- java programming (Java)
- Problem with JAVA and XP & a few missing choices. *bangs head on desk* (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: nullpointerexception error
- Next Thread: learning java
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer html ide image inetaddress integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows







and Advance Merry Christmas....