ashwathi rao

Greenhorn
+ Follow
since Mar 26, 2009
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 ashwathi rao

This is my diorectory structure:
I have created










I had used c:\swathi\practice\source javac -d ../classes exam.Study.java to create the class files under c:\swathi\practice\classes\ exam with same directory structure above follwoing the package structure



Now as per norms we should be running the files from classes so I used c:\swathi\practice\classes java exam.Study

So this started using the HelloWorldsApp file in beverage since its importing it from beverage. But I want the Study.java to use the HelloWorldApp file in the exam package. I tried overriding it

c:\swathi\practice\classes> java -classpath c:\swathi\practice\classes exam.Study

c:\swathi\practice> java -classpath c:\swathi\practice\classes exam.Study

either ways its executing the beverage.HelloWorldApp file.

1)Is the import statement problematic or what is the issue?

2)If I delete the import statemnt Study is using exam/HelloWorldApp file am unable to force it to use beverage.HelloWorldApp file.

3)Am I executing the command from wrong directory I mean It should work from classes package right.Once we define a package for class files like package classes we can call jvm from classes package right or should we alsways use source package even while running them. I mean once class files are created from where are we usually supposed to call/run the class file source or classes package..


I really appreciate all your time and help.I have also added the same directory structure a source and classes attachments....please review them if the above picture is not clear.


Thank you all ranch.....for sparing your precious time for me.


ashwathi
8 years ago
I have the following structure...I tried to execute the HelloWorldApp.class file in exam directory by overiding the classpath but always I keep getting the beverage helloworldapp output nomatter what path I set.I tried a lot.It give an error saying class not found.If I take out the import statement from Study it executes the exam helloworldapp but either ways I found the classpath is not being overidden but it just identifies the "." for the current directory.It is not accessing the file I want it to like in SCJP6 by K&B Chapter 10 Developement Test Question 9. Also I gave the java command from the c:\swathi\practice\classes it did not work. According to book it actually should please help me out .

I really appreciate your time and help.Thanks in advance to all of you on the ranch.

c:\swathi\practice\classes\exam\Study.class

package exam;
import exam.beverage.HelloWorldApp;
public class Study
{
public static void main(String args[])
{
System.out.println("exam/Study");
new HelloWorldApp();

}
}

---------------------------------------------------------
c:\swathi\practice\classes\exam\beverage\HelloWorldApp.class

package exam.beverage;
public class HelloWorldApp {

public HelloWorldApp()
{
System.out.println("Beverage Constructor Hello World!");
}


public static void main(String[] args)
{
System.out.println("Hello World!"); // Display the string.

new HelloWorldApp();
// h1.HelloWorld();
}


}
------------------------------------------
c:\swathi\practice\classes\exam\HelloWorldApp.class




package exam;
public class HelloWorldApp {

public HelloWorldApp()
{
System.out.println("Exam Constructor Hello World!");
}


public static void main(String[] args)
{
System.out.println("Hello World!"); // Display the string.

new HelloWorldApp();
// h1.HelloWorld();
}


}
-------------------------------------------------------------

ashwathi
8 years ago
"it is uncommon to use a return statement in a finally block, because it effectively eliminates all choice of return value. Whatever you want to return, it will always be the finally block's return statement that runs before any other return statements, because finally must always run before your method returns. "



I did not understand this point still confused.
1)What is the order in which the return statements in try,catch,finally blocks get executed?

2)A finally executes no matter what the condition is ,so as I understand the method(handles the exception) that is calling the risky method(throws the exception) has a return statement at the end will be executed after the return statement in finally block .

3)The return statement in try,catch and finally blocks is what the risky method was supposed to return,because when the risky method throws an exception the control jumps to catch or finally block depending on what is written and the compiler still waits on a return value from the risky method.Is my understanding correct.

Appreciate your time and help .

ashwathi
Hi all,

I am planning to take SCJP6 exam by mid June2011 .As of now I started brushing my java concepts using Head First Java book.I plan to read SCJP certification book by Kathy .I have a few questions:

1)Is it the right time to take exam in mid of june from now or too early because I would be finishing Head First java in another 10 days and start Study Guide by Katherine Sierra and Bert Bates (K&B).

2)Will the swing concepts be tested in SCJP6 test.can I skip them now in HFJ.

3)In the exam do we get only multiple choice and drag drop type questions or do we need to write programs there?I am writing the SCJP 1.6 (310-065).

4)As of my experience with java just beginner level ,learnt during college semester work.


Any suggestion are welcome.


Appreciate your time and help.
Thanks again.

ashwathi
Well I just tried checking now.
When I place the source file in jdk\bin folder it compiles and runs as well generating the desired output.

But when I tried doing the same out side the bin folder the program only compiles but doesnt run and produce output .I suspect the error with the path I set.
I created a user variable
Path C:\swathi\java\bin

Is there anything else I should set apart from the user variable.Is the system variable also to be set?I guess with my error the jvm is not able to run the program.

Appreciate all of your asap

Thanks in advance
9 years ago
I have installed java1.6.0_24 and also compiled a program error free.But the program doesnot seem to run.It gives the following error at command line

Error: could not open 'C:\swathi\java6-x64\lib\amd64\jvm.cfg

I donot understand what is the problem.

Also previously I installed both windows and 64 bit version of the jdk tool kit from sun.com Finally got rid of both using windows install cleanup, since I could not run any programs.
Then I installed the jdk1.6.0_24 and compiled and also run a program previously.
After that I renamed the folder in which I installed the jdk.I also made a point to make appropriate changes to the PATH variable in environment variable.
No program seems to be running now all they do is get compiled .
I again tried installing but still the same error pops up at command-line.

What is the solution.Is it a serious problem.

Currently I installed it in C:\swathi\java\....(contains all bin etc folders)

Should I let it install in Program Files with its default settings.?
Is my customizing the installation directory creating the problem?

I appreciate your help.
9 years ago
Thanks Mike. It has solved the problem. I could uninstall the left out jdk files and install again.

I really appreciate your help
9 years ago
Hi all,

I am new to java.I have tried to install java 1.6 udate 24 for 32bit.But later found that my dell laptop has the follwoing configuration: processor core2 duo intel ,System type 64 bit.So I thought may be I should be installing the java for windows x64 version and I installed it.Later on I deleted it i mean all folder and then downloaded the jse-jdk java 1.6 udate 24 for 32 bit the usual one.Somehow due to some reason I had to delete it .I did not uninstall any of those from Programs and Features .Now I understood the difference between 64bit and 32 bit.
Unfortunately am unable to install any of the version now even though I have deleted them.Even the unistall from Programs and Features still has those in Control panel and I get the following error when i try unistalling them.Error 1723.
Also when i dowloaded the jdk1.6 u24 , while installing it asked if I would like to reinstall as it alredy exists but when I say yes to reinstall i get 1723 again.

Error 1723:
there is a problem with this Windows Installer package.A DLL required for this install to complete could not be run.Contact your support personnel or package vendor.

Please help me out.Also I tried testing if it were a problem with the windows installer but other programs like skype could be easily installed and uninstalled.
What are the next step which I should take so that I can install the suual jdk1.6 u24 and start working on java for my course.

I have a vista home premium with sp2 as operating system.And I have also noticed two IE now in my system.One is the regualr 32 bit amd there is another one which says 64bit edition.how should I deal with this problem now.


Appreciate your help





9 years ago
Hello everybody,

I have downloaded JDK6update 13 onto my system successfully ,its size is 73MB.The problem is its file extension is jdk-6u13-windows-i586-p.exe in the sun's download site and once I manually download i.e offline downloading so I can install again later its extension is jdk-6u13-windows-i586-p.efw. I am unable to install JDK6 now though I could download it.and I tried finding help on sun's website still unable to solve ..please help me with this issue.Am kind of stuck with this...

thanks and would appreciate your help
ashwathi
11 years ago
Thanks a ton to all of you ....what do you suggest regarding a small rather a mini project before I start preparing for SCJP6? well I just thought of improving and getting better and then go ahead with SCJP...all I for sure know its painful process .....any suggestions OR is it better to do normal practice alongside for small programs and go straightway for SCJP6? Which all of you think is a better choice?

Thanks and appreciate your help
ashwathi
Hello Everybody

I am starting java from scratch now and I bought the following books:

HFJ 2nd edition
Java Dummies for Java 6(all in one)
SCJP 6 by Kathy n Bert

My goal is to learn java ,practice simple programs and do a very small project which would help me understand concepts better and then go ahead with SCJP 6.
All this in around 5 months or so.Would this be possible or I should change any of my steps in plan for certification i.e SCJP 6.

I had done a mini project around 4 years ago and lost touch completely with java,and moreover I could not improve or test my programming skills during the commencement of project as it was a group with only 1 person programming all the time.I had no much chance to do proper programming even at a beginner level.So, What do you suggest me with the above plan,because I want to complete SCJP 6 by 6 months with some proficiency in java before joining university,so I can carry on my projects with less hassels and less dependency.


Would appreciate your help n thanks a ton
ashwathi
Hello everybody

It says that this HFJ 2nd edition covers java 5.0. But I found no latest edition and bought this for starting my basics in java, and doing a mini project at beginner or student level and taking
the SCJP 6 exam. Did I buy the right edition because I dint find anything more latest? Can I continue preparing for SCJP 6. with this book itself?

Thanks and appreciate your help

ashwathi
11 years ago