Nibin Jacob Panicker

Greenhorn
+ Follow
since Aug 16, 2005
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nibin Jacob Panicker

Thanks Prabhu.
i am using jdk5.0
are there any performance issues with either of the casting ? or both are the same.
16 years ago
appreciate if someone could explain the diffrence in the following 2 ways of casting an object.

1) Object a = new MyObject();
MyObject b = (MyObject)a;

2) Object a = new MyObject();
MyObject b = MyObject.class.cast(a);

Which one should i use ?
16 years ago
Someone please explain me the use of @Temporal annotation in entities. ejb persistence spec says we should use this annotation for properties of type java.util.Date and java.util.Calendar. I tried with and without this annotation and could not figure any difference.
The + operator is overloaded only for String objects.u cannot use it any other objects , in ur case its a Byte object.
Could someone please give me the steps i should follow inorder to save an image into the OracleDB.after searching google i came to know that the image can be converted to a BLOB object which can be saved into the DB.but i couldnt find a method to convert an image object to a BLOB object..
17 years ago
Could someone please give me the steps i should follow inorder to save an image into the OracleDB.after searching google i came to know that the image can be converted to a BLOB object which can be saved into the DB.but i couldnt find a method to convert an image object to a BLOB object..
17 years ago
i tried in both jdk 1.5 and jdk 1.4.1 ..in both im getting the same output i.e false
I wonder how you got 'true' for the first one.. it shouldnt be true as far as i know..
hope the following code will give you some idea.

abstract class A{
abstract public void print();
}

interface B {
void print();
}

class C extends A implements B{
public void print(){
System.out.println("Inside Print");
}
}

public class TestClass{
public static void main(String args[]){
A a = new C();
a.print();
B b = new C();
b.print();
}
}

When run, it prints "Inside Print" twice which makes it clear that the print() method in class C satifies both the abstract class and the interface.
hope the u forgot the write the abstract keyword for print() method in class A,otherwise it wont compile.

here,ur extending an abstract class A, so ur expected to override and defive print() method.since ur implementing the interface B also,u have to write code for the print() method declared in interface B.its interesting that both class A and interface B have a print() method with same signature.so to satisfy them u need to define only one print() method like

public void print(){
//some code.
}

in the class C.here both interface and abstract class will be taking the same print() method.
if u notice 'lookupValue' is a constant which has got a static modifier also..as far as i know constants are resolved at compile time and not runtime.so,it will print the value of 'lookupValue'.

correct me if im wrong
When b.run() is executed,it will call the run() in the parent class ie the Thread class.The Thread class has blank implementation of run() method like

public void run(){
}

so calling b.run() wont give any output..
The main diffrence btw HashTable and HashMap is that HashTable methods are Threads-Safe(meaning they are synchronised methods) while HashMap is not ThreadSafe..So basically HashTable is used when more than one thread will be accessing it..
thank you buddies..but my doubt was why cant java do implicit casting for
byte b=1;
b= b+1;

why cant java compiler take it as b = (byte)(b+1) during compile time??
if it does that during compile time there shouldnt be any harm whatever the value of b would be ..rgt??