linus dale

Ranch Hand
+ Follow
since Jul 01, 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 linus dale


the latest SCJP exam I believe is SCJP6
how much time till the next one comes

I haven't purchased a voucher
I want to appear for scjp within 3 months from now
should I purchase scjp 6 voucher or wait for a new one
please reply
thanks

Campbell Ritchie wrote:Please go through the Java™ tutorials section about I/O and have a look at the documentation in the API for FileOutputStream. I thought a FileOutoutStream was not suitable for .txt files, and you should use a FileWriter instead. But I am not up to speed about byte[] arrays, I am afraid; somebody else may have a better idea.




I got it
it was because I had 2 files called File3.java in different folders

i was making changes in the wrong file
9 years ago

this program takes name of a file as command line argument
and copies contents of that file to a newly created file called newfile.txt

newfile.txt is formed but nothing is written to it

and if newfile.txt already exists,and has something in it,it becomes empty
why is this happening?





please help
thanks
9 years ago

Rob Prime wrote:Linus, you've been asking quite a few starter questions lately. Perhaps it is a good idea to read through the Java Tutorial. This particular subject is discussed in its Swing section mostly.


thanks
problem is I am a not much of a reader
9 years ago

Maneesh Godbole wrote:It should be manifest.mf.
What you have posted indicates what happens when you build the jar, whereas you initially indicated you already had a jar which was not working.

Please provided answers to the two questions I asked previously. Until we get that information, we would not be able to help you.




ok ,now it is working .I was opening it with jawaws instead of javaw in the bin folder
jar files open on double click,but ONLY for programs that have GUI output
manifest.txt as well as manifest.mf, it works for both



Why do jar files for simple(command line output) programs do not open on double click?



all jar files(GUI and non gui) open from command line now
>java -jar filename.jar
9 years ago

Maneesh Godbole wrote:Something funny happening here. JNLP file is usually used for JWS. You mention you are double clicking, i.e. the jar file exists on your file system.
1) Can you post the contents of the manifest file (inside the jar)?
2) Also, can you try invoking the jar from the command line (java -jar JarFileName,jar) and provide us the full stack trace?




for another program with 2 classes the jar file doesn't form at all
it is in a different folder jar1

manifest.txt contains
Main-Class: TestII


on doing
jar -cvmf manifest.txt app5.jar *.class
I get

java.io.FileNotFoundException: manifest.txt (The system cannot find the file spe
cified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.tools.jar.Main.run(Main.java:122)
at sun.tools.jar.Main.main(Main.java:903)
program



please help
thanks
9 years ago

Maneesh Godbole wrote:Something funny happening here. JNLP file is usually used for JWS. You mention you are double clicking, i.e. the jar file exists on your file system.
1) Can you post the contents of the manifest file (inside the jar)?
2) Also, can you try invoking the jar from the command line (java -jar JarFileName,jar) and provide us the full stack trace?




manifest.txt file is
Main-Class: HelloWorld

from the command line
java -jar JarFileName.jar
the jar file opens and gives the required output
9 years ago

I get this message when I double click a jar file that i created
An error occurred while launching/running the application.

Category: Launch File Error

The following required field is missing from the launch file: <jnlp>

where is the launch file located
9 years ago

Campbell Ritchie wrote:It is also an object of the Animal class.

This shows dynamic binding, but also shows the hazards of hiding fields. You can get confused because both Dog and Animal classes have a "type" field.





also i wanted to know what all the signature of a method includes

name of method,no. of arguments,data type of arguments
and return type(I am not sure about return type)
9 years ago



doubt
line no. 68 to 69
is this
Button b=((Button)e.getSource());
typecasting
what does this line do?
what is the use of getSource,getLabel,setText
9 years ago

tushar panda wrote:Is anyone over here interested in astral projection .




yes
read about it
somewhere

yogis/monks in Himalayas are said to live for about thousands of years
they live in a different 'plane'
they can appear (as a regular human) when they wish to

and those doing astral travel claim to having gone and met them
9 years ago


Dog is subclass of Animal
my doubt is,finally,
doggie is object of class Dog or of class Animal ?

if doggie is an object of Dog,
doggie.show will obviously call show method of Dog and not Superclass Animal
(because of method overrriding,if I am not wrong)
9 years ago
Which Oracle certification exam applies for me

after having studied
Introduction to Oracle9i:SQL

volume 1 and volume 2,oracle university books

there are in all 20 chapters
last chapter is "extension to DML and DDL statements"

Ulises Pulido wrote:Is correct because InputStream is a superclass of FileInputStream.

You can assign directly a reference of a child class to a parent class.


As far as I know there are not such classes you are asking for

But there are FileReader and FileWriter.



thanks
9 years ago