Jesper de Jong wrote:java.lang.NoClassDefFoundError: javax/mail/MessagingException
This means that you are missing the class javax.mail.MessagingException.
You'll have to include the required JAR files in the WEB-INF/lib directory of your web application, just like you put them on the classpath for a standalone application.
Ian Paul Budiman wrote:Hi all,
I am a newbie here, and have tried several exercises from Head's First Java, can someone help me with the logic of this:
Where the result is:
helloooo...
helloooo...
helloooo...
helloooo...
helloooo...
46
And I have tried to change the last code to become:
System.out.println(e2.count);
Which resulted the same.
Have examined this for few days but to no avail.
Any help on the logic to get the answer "46" in both cases above mentioned would be much appreciated.
Regards,
[Edit - added code tags - MB]
Mushraf Khan wrote:Thanks a lot. Yes, Amey , my question was to access interface variable from main. Its clear to me now. Thanks Sebanti also for the explaination
Mushraf Khan wrote:GoodDay EveryOne
Anyone who could help me with this doubt, I will greatly appreciate it. Please.
abstract class Test{ int i =10;}
interface inter{int i = 2;}
public class NewMain57 extends Test implements inter {
int i = 9;
public static void main(String[] args) {
inter n = new NewMain57();
System.out.println(n.i); -----> Prints 2;
Test n = new NewMain57();
System.out.println(n.i); -----> Prints 10;
NewMain57 n = new NewMain57();
System.out.println(n.i); -----> Prints 9;
}
}
Is this right(although i ran in netbeans , got these answers). Is there any way we can get the variable i of inter interface into NewMain57 class (other than this) as this class inherits the variable of inter interface which is public static and constant.
Mushraf Khan wrote:GoodDay Everyone,
Anyone please who could help me to clear this doubt. I have read that objects passed to the method cannot be garbage collected inside the method, because this was not the place they were created. This program is crude, just listed the above concept in program. Is this right.
In method tt() , k is made null, means can be garbage collected, also when the method is executed all objects created are lost, unless the reference is passed. So based on the above, n is not garbage collected, as it was just passed to the method, and was created outside the method.
public class NewMain58 {
public void tt(NewMain58 k){ k = null;}
public static void main(String[] args) {
NewMain58 n = new NewMain58();
n.tt(n);
}
}
O. Ziggy wrote:
Amey Ambulgekar wrote:
O. Ziggy wrote:
Why is the above not allowed? Ball implements Bouncable (Ball IS-A Bouncable) so i thought i should have been able to pass it a Bouncable reference.
Thanks
hello O.Ziggy,![]()
about your program i run on eclipse or even i run through notepad it is not giving me any error it works fine![]()
![]()
well check my code if you found any error then tell me ::
interface SampleInterface{
}
class ClassImpl implements SampleInterface {
}
public class InterfaceDemo {
public static void main(String[] args) {
SampleInterface si = new ClassImpl();
fun(si);//<-- your error was here right?![]()
}
public static void fun(SampleInterface si1){
}
}
Thanking you.![]()
no it is not the same.. i am passing a Bounceable to a Ball. You are passing a SampleInterface to a SampleInterface so in your case there is no conflict..![]()