| | |
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 |
911 actionlistener addball addressbook android api append applet application array arrays automation binary bluetooth button character class client code component consumer css csv database desktop eclipse ee error fractal ftp game givemetehcodez graphics gui html ide image integer j2me japplet java javaarraylist javac javaee javaprojects jni jpanel julia jvm linked linux list loan loops mac map method methods mobile netbeans newbie objects online oriented output panel phone printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server service set sms software sort sql string swing test threads time transfer tree ubuntu update windows working







and Advance Merry Christmas....