Harjeet Dadwal

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

Recent posts by Harjeet Dadwal

Sorry friend,
as you said that we'll have to define main method then it's not true, a static method first called by any class, what I've explained above, I've compiled it and 've executed successfully once, but what's the problem now, why it doesn't run now, I don't know ? but when will figure it out will tell you,
however thanks for your reply !!!

------------------
Harjeet Singh Dadwal
23 years ago
can I've class without main method ?
here I tried out
rectify the error please:-
class trial
{
public static void withoutMain()
{
System.out.println("Hello how are you !!!");
System.exit(0);
}
}
Where is the problem, help me ?
------------------
Harjeet Singh Dadwal
23 years ago
Here are some questions
1) what is difference between getPath() and getAbsolutePath() in file handling ?
2) what is difference between Reserve word or Keyword in JAVA and how many keywords are there in java ?
3) where can we get exercises or assignments of different java topics, just for practice ?
------------------
Harjeet Singh Dadwal
23 years ago
1> when an object of class is created then if we haven�t defined any constructor for that class then the default constructor runs, WHERE THIS DEFAULT CONSTRUCTOR LOCATED IS ?
2> why the local variable cannot be declared final ?
3> We cannot print an object of a class directly using println() method , we have to call toString() method but why object of class File is printed directly:-eg. File fi=new File(�C:\dir1\file1.txt�);and it prints as using System.out.println(f1);
4> What is difference between getPath() and getAbsolutePath() in file handeling ?
5> Is there no method to create file directly as we create directory ?

------------------
Harjeet Singh Dadwal
23 years ago
whoops......!!!
sorry Mathias It was not working yesterday but today runs without modification, I couldn't understand what happened but thanks anyway, very thanks to you for your reply.
bye
------------------
Harjeet Singh Dadwal
23 years ago
I couldn't understand about the bin I'll check it agian will post the question in detail.
however thanks for the reply!!!
------------------
Harjeet Singh Dadwal
23 years ago
*** what is the file called having extension as bin I downloaded a software and when I unzip it then in that there was files having extensions as class except one whose extension was bin, how to execute that one, help me.
*** can a class file be converted into java source file, is there any tool to do like this ?
------------------
Harjeet Singh Dadwal
23 years ago
if this is activated by JVM then it is OK otherwise according rule it is illegal to call a function without specifying a parameter which has already been defined while function is defined, Am I right ?
However Very thanks for your reply,
thanks again
------------------
Harjeet Singh Dadwal
23 years ago
I'm doing following code but it doesn't work, why ?
I'M EXPLAINGING HEREUNDER:-
I created a directory in jdk1.3\bin named as p1
and then created a file named as Class1.java in p1
eg.

then I compiled it as:-
f:\jdk1.3\bin\p1>javac Class1.java
Then I created a directory p2 in jdk1.3\bin\p1.
and created a java source file named as Class2.java
eg.

and then compiled it as:-
f:\jdk1.3\bin\p1\p2>javac Class2.java
And then created a file at root directory of p1 named as Importer.java
eg.

then I compiled it as:-
f:\jdk1.3\bin>javac Importer.java
BUT IT GIVES ERROR AT COMPILE TIME AS:- Class1 is a bad file name
no class file in p1.Class1 specify the correct path
But if change the code of as in Importer.java as import p1.Class1
and import p1.p2.Class2
then it comiples successfully and run fine.
PLEASE TELL WHY IT DOESN'T RUN USING "*" ???
------------------
Harjeet Singh Dadwal

(added code tags)
[This message has been edited by Marilyn deQueiroz (edited September 16, 2001).]
23 years ago
But I read in a book that there is a difference in that but no difference was described there.
* here we define function called method in a class itself that is why it is called method,
I think I read like this but I'm not able to remind which book I read in.
23 years ago
In main mehod there is a one paramenter is given as string
*** public static void main(String[] args) ***
string args is given to pass comandline argument but if we don't pass any argument then it runs without any error but as a function or method rule if we define a function or method having an argument then must be passed while calling that method but if we don't pass any commandline argument then how it works....?

------------------
Harjeet Singh Dadwal
23 years ago
What is the difference between method and function, why don't we call function in java instead of method whereas in c or c++ called function, is there any difference between function and method.
------------------
Harjeet Singh Dadwal
23 years ago
where is the check list located pla. ?

------------------
Harjeet Singh Dadwal
23 years ago
thanks to you for your reply
------------------
Harjeet Singh Dadwal
23 years ago
*****Method declared in interfaces must overriden by the class implementing the interface and method body has to be defined or constructed then we can do this one without implement the interface, I mean there is no need for interfaces, if we have to write the entire body of the method declared in interface then why interfaces are needed if we have to write the code again ?
------------------
Harjeet Singh Dadwal
23 years ago