Anita Singh

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

Recent posts by Anita Singh

Thanks a lot
14 years ago
Congratulation
Perfect Score
14 years ago
Hello,

I passed SCJP 5 with 100%.
14 years ago
Congrats Anil

Nice Score
17 years ago
Hi,
I have saved the password in database in Encrypted form successfully.But it shows me "javax.crypto.BadPaddingException: Data must start with zero" Exception while Decryption.I m posting here both the Encryption & Decryption code.Please Help Me.


/*Encryption program is working fine*/
************************************************************************



Please help me
Thanks in Advance
17 years ago
Congrats Abdul
Good score
17 years ago
Hi Rajesh,
You can not access private constructor from outside the class,
If you want to access the constructor from outside class,you have to make this constructor as "public".

class drinks
{
public drinks()//public constructor
{
System.out.println("i am abstarct constructor");
}
}
class PracticeTest
{
public static void main(String[] args)
{
drinks d=new drinks();
}
}

Thanks
Hi Chandra
Congrats
very good score
17 years ago
Hi,
NullPointerException is thrown here,but you are printing that exception.
make some change in your code:

public class PracticeTest {
public static int[ ] getArray() { return null; }
public static void main(String[] args)
{
int index = 1;
try
{
getArray() [index=2]++;
} catch (Exception e)
{
System.out.println(e);//change
}
System.out.println("index = " + index);
}
}
Now you will see that your program is throwing NullPointerException.
public static void main(String args[]){
float a=8;
float b=3;
float f;
f=(float)(a++/b--);
System.out.println(f);
}

if You do in this way then it gives you 2.6.
Because in your case a and b are int,and the result is based upon int division,thats why answer is 2.0 not 2.6
Hi
Here you are comparing String literal to array of String Object,by using ==,it is not possible.
If you want to do this,then write
if(s1.equals(args[0])
{
System.out.println("equal");
}

Thanks & Regards
17 years ago
Hi,
You are telling that B.java is also in test package,but You are not using package statement there.

use package test;
in B.java also.
& remove import statement from there.

Then compile both the java file using below comand:-
javac -d . A.java
javac -d . B.java
it crete the folder test & put your class file there &
for running B.java write:-
java test.B

Anita Singh
17 years ago
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
wait():-Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
notify():-Wakes up a single thread that is waiting on this object's monitor.
notifyAll():-Wakes up all threads that are waiting on this object's monitor.

Anita Singh
17 years ago