MohamedSalim malik

Greenhorn
+ Follow
since Feb 04, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by MohamedSalim malik

Hey friends ,
Can anyone tell me about this Java and C# debacle . The Answer i want to know is , that whether the Microsoft create C# out of java. Is C# a copy of Java ?. I want to know about this history for a assignment. i have Google about this matter already . But i couldn't find good information . so if anyone know about this , please be kind to share the links . thank you
12 years ago
Wow, I got it now. Thanks a lot Sebanti Sanyal for your Short and Sweet answer. You are awesome
Hey friends , i have this problem with Thread Synchronization. please look at the following class where i created two threads by implementing Runnable interface. in here i can only get the results ABAB, Because
I am using two different threads with two different runnable targets. Am i correct. I only want to know my theory is correct? please somebody tell me.





and The second class , I can get two results as "ABAB" , and "AABB" . am i right? It is because i am using the same runnable target for different Threads . Is my theory correct. or please somebody tell me if the way i understand is wrong. and please forgive my bad use of English.






There were no reassignment happened. C variable only got assigned inside the constructor. You have to initialize the final variable before constructor finished. please correct me if i am wrong. forgive my bad English .
Thanks alot Walter.. sorry for this delay to reply. your solution did work .
12 years ago
My problem is , i can access( or print) that s variable from inside the method; but i cannot access( or print ) it from the class itself. when i try to do like that(uncommenting the line) it gives me a compilation error. why is that?
As i know, a method local inner class can access any instance variable from the outer class. but here i get a compilation error. thank you
12 years ago
Guys, I am Studying for OCJP exam. i got this problem today . Anyone please give me an answer for this



As you can see in this above code , i can print the variable 's' inside the method that is located inside the method local inner class. but why i cant print the same variable inside method local inner class itself(i commented out that line). it gives me a compilation error. anyone kind enough to explain me.
12 years ago
Awesome artical.. now i got it.. thanks for your help.. :
13 years ago

In my SCJP class they taught us like Strings are considered as Objects in java.. If so the above s1,s2 should be two references which points to TWO OBJECTS . Am i correct.?
But when i compile and run this i got a result showing true. I am confused


then i made another program..




When i run this, it showed the boolean value as 'false'. It indicates that this is two different objects.(is that correct?) My question is that, which is considered as
a OBJECT in java From above two declarations.?? can someone explain me?
13 years ago
Thank you Rob Spoor .. yeah that the point where i did the mistake. i didnt convert the string value to a double. then i corrected the source code, and it did work.. :

class E{
public static void main(String args[]){
double gpa=Double.parseDouble(args[0]);
if(gpa>=3.6)
{
System.out.println("First class");
}

else if(3.59>=gpa && gpa>=3.4)
{
System.out.println("Upper Second class");
}

else if(3.49>=gpa && gpa>=3.00)
{
System.out.println("Lower second class");
}

else if(2.99>=gpa && gpa>=2.00)
{
System.out.println("Pass");
}
else
{
System.out.println("Fail");
}
}
}
13 years ago
Yeah thank you for advice. : I tried to pass the argument to the variable using command line. i tried in various ways . but still this error occurs.. This is the error message occured when i try to compile the program.
E.java:3: ';' expected
double gpa(args[0]);
^
E.java:3: not a statement
double gpa(args[0]);
^
E.java:3: ';' expected
double gpa(args[0]);
^
3 errors
13 years ago
I try to build this if-else by passing a command line arguament to the variable gpa.but i get an error. can someone help me please with this problem. thank you


13 years ago
What is really mean by pass by value and pass by reference. Is java using both methods. How can we identify these two methods. and what is the most appropriate method?
Can anyone help me please with a example.. thank you. :
13 years ago
Thank you Fred rosenberger .. Your method helped me alot.. : I followed those step by step method you have mentioned and i got the out put.. Thanks for sharing the idea.. :
13 years ago