aditya makam

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

Recent posts by aditya makam

Sorry Dave,

As I was using servlets,I thought I had to post this query in servlets section.So I have posted that in this section.

Thank you very much
aditya
19 years ago
Sir,
I developed my application using servlets.
I have two systems connected through LAN.(Aditya,Vijay).The purpose of my application is to read from a file( in Vijay) and write the contents to the database which is on the server.(Aditya system.)But I am running application in Vijay system as shown below:

I am running tomcat server using http://Aditya:8080/ on Vijay system.

I gave the path of the file (for ex :E:\work\word.doc)which is in Vijay system and now I want my application to read the data from the file and insert into the database which is in server(Aditya system).
Its giving the exception "FileNotFoundException". It is not able to identify or access the file?

yours friendly,
aditya makam
19 years ago
hi,

Can anybody answer the question? or what might be the answer for this question?


under what condition will check return true when called from a different class.

bye
aditya
Hi,

In the above code, you have to understand the overriding concept of methods.See the below example

For the above program,it will print derived three times.It will always call the print() in derived class,bcoz you have overridden it.

In the same way for the program which you gave ,at the statement

bogo(new Extension()); This will goto constructor of Extension and then u can assume super(); by default ,so it will goto base class constructor now it will call add(1),then the method in Extension class will be called.
Now i value is 2. Again it will come back to Extension constructor ,now it will call add(2) ,now the method in Extension will be executed and i value becomes 6. Now the creation of the instance (new Extension()) is over. It will go into the method. Now b.add(8) will be called.Now also the method in Extension class will be called,bcoz you have overridden the method add().i value becomes 22.

I think this explaination might have helped u.If I am wrong,correct me.
Hi,

Thank you very much for your reply.
Hi friends,

This is the program.

interface I
{
void setval();
}
class Outer
{
String str;
public static void main(String arop[])
{
Outer out1= new Outer();
out1.method();
}
void method()
{
final String str1;
I obj = new I(){
public void setval()
{
str="aditya";
str1="makam";
}
};
obj.setval();
}
}


Its giving compile time error as shown below.Can anybody explain the reason?

waiting for your reply,

aditya makam
hi everybody,

public class AQuestion
{
public void method(Object o)
{
System.out.println("Object Verion");
}
public void method(String s)
{
System.out.println("String Version");
}
public static void main(String args[])
{
AQuestion question = new AQuestion();
question.method(null);
}
}

This is the program.It is giving output as String version. I thought it will give compiletime error,bcoz of ambiguity.

Can anyone explain the reason why it is giving string version.? why isnt calling the method with Object as argument?
Hi everybody,

This is aditya makam. I am a new member of this group. I hope u ppl help me. Here is my doubt.

In java if you compile the following code.

class ByteTest {
public static void main ( String args [ ] ) {
ByteTest t = new ByteTest(10);
}
};

It will give CompileTime error.Because compiler is thinking that 10 is an int literal,but in Byte class only two constructors are there which take arguments as byte ,String.But if consider the following code,


class ByteTest1 {
public static void main ( String args [ ] ) {
byte b =10;
System.out.println(b);
}
};

It will get compiled and will print 10 as output.

My doubt is ,here also 10 is an integer literal and we are trying to store in byte variable.But it is not giving compile time error.Why is it so?

Plz anybody who can explain plz give me reply...to this message.


yours friendly
aditya