Skip to main content

Help me with this code please!!!!!

1 reply [Last post]
deepak_java_pro...
Offline
Joined: 2009-09-13
Points: 0

Hello,
My name is deepak and i am new to java infact i have started learning java from today itself.Here are my questions:-

(Question1)Can anybody please help me out with this code of simple addition. I am having 2 errors in it. The code i am writing is :-

============================================================

class add {
int i, j, k;
public void aad(int p, int q){
i=p;
j=q;
System.out.println("A + B = "+ (i + j));
}
class try {
add A = new add();
A.aad(2,4);
}
}

============================================================
The errors are:-

File: D:\practice\add.java [line: 8]
Error: D:\practice\add.java:8: expected

============================================================

(Question 2).My next Question is that i have done my bca from distance learning with 55% marks and i am doing mca from distance too ( MCA 5year integrated i.e.,3 years bca + 2 years mca ).if i passes my SCJP exam then what are my future prospects? will i get a decent job before i complete my MCA ?

Thank U for your precious time to read and reply in advance...........

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
zakobixs
Offline
Joined: 2009-09-25
Points: 0

class try {
add A = new add();
A.aad(2,4);
}

don't use [b]try[/b] for the class name