Jason sigel

Ranch Hand
+ Follow
since Oct 07, 2003
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 Jason sigel

Hey thanks, those were helpful tips.
Jason.
17 years ago
Thanks!!
But am still confused with the method thing that u wrote above.
Say for example, i have the metho
String getISBN(String title){
blah
blah
}
and now i call it using, say
Integer approvedIsbn = this.getISBN(approved_num);
Here i am passing it an integer namely approved number, so how do i convert it into a string before calling the getISBN method.
thanks in advance
Jason.
17 years ago
Hey guys!!
I have written a piece of code in which i have defined a method which takes in a String object as an argument.
When i actually call the method in my code, i pass it an integer(in one of the calls). How do i convert THAT integer into a string so that my code works fine?
I know there is the toString method...but am not sure how it works.
Jason!!
17 years ago
One more question related elementry thing here.
why I have to initialize d=0.00 here in the code .

WHY NOT JUST double d=Double.parseDouble(br.readLine());}
jaideep

[This message has been edited by Ajith Kallambella (edited September 27, 2000).]
tHANKS AJITH,
I got where I had made mistake.Yes UBB code make effective way to present code.
Marie you are right.This is what I am doing here.I am taking input stream and passing it to buffered reader.
InputStream converts bytes to char and buffered reader is character reader.
jaideep

H:\JAVA\Weblogic>java -ms16m -mx32m -noasyncgc -verbosegc weblogic.T3Server
Warning: -noasyncgc option is no longer supported.
<GC: need to expand mark bits to cover 262144 bytes>
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/T3Server

I am getting this error when running startT3 in weblogic directory to Install it.I had got it from servlet book cd.
How do I install it.As such there is no directory with name weblogic or T3Server in it.
Will I have to download new weblogic server?
Is J2EE is essential for compiling EJB basic program.
How could one write a simple Ejb program and what it need to run?
Need some direction.
jaideep
21 years ago
I want to know what is parser in Xml ?.Is it remove tags from a html file as we use stringtokenizer to remove . / from urls.
I only know that we can make our own tags and can define thier properties/data types .
How I should relate basic xml with java.
Is java and xml by brett mclaughlin is for beginners ?

jaideep

and


/*
here nothing happens untill I store new mframe1() object is frame f object and call f.show().
frame f=new mframe1();
f.show();
please explain it to me.Is it due to layout as in border layout I don't have to add f.show.
*/

Do layout have different initialization format.
jaideep
import java.awt.*;
import java.io.*;
public class mframe extends Frame{
Button bn,bs,be,bw,bc;
public mframe(){
super("maha");
Button bn = new Button("North");
Button bs = new Button("South");
Button be = new Button("East");
Button bw = new Button("West");
Button bc = new Button("Center");
setLayout(new FlowLayout());
//add(bn); add(bs); add(be); add(bn); add(bn);}
try{
add("North",bn);
setSize(300,300);
setVisible(true);
System.out.println("Added north and sleepling");
Thread.sleep(2000);
add("East",be);
setSize(300,300);
setVisible(true);
System.out.println("Added East and sleepling"); Thread.sleep(2000);
add("South",bn);
setSize(300,300);
setVisible(true);
System.out.println("Added South and sleepling"); Thread.sleep(2000);
add("West",bw);
setSize(300,300);
setVisible(true);
System.out.println("Added West and sleepling"); Thread.sleep(2000);
add("Center",bc);
setSize(300,300);
setVisible(true);
System.out.println("Added Center and sleepling"); Thread.sleep(2000); }
// catch(InterruptedException e) {}
}
public static void main(String args[]){
new mframe();
} }
import java.awt.*;
import java.io.*;
public class mframe1 extends Frame{
Button bn,bs,be,bw,bc;
public mframe1(){
super("maha");
Button bn = new Button("North");
Button bs = new Button("South");
Button be = new Button("East");
Button bw = new Button("West");
Button bc = new Button("Center");
setLayout(new FlowLayout());
add(bn); add(bs); add(be); add(bn); add(bn);}

public static void main(String args[]){
new mframe1();
} }
/*
here nothing happens untill I store new mframe1() object is frame f object and call f.show().
frame f=new mframe1();
f.show();
please explain it to me.Is it due to layout as in border layout I don't have to add f.show.
*/
jaideep

D:\mycode>javac my1.java
my1.java:10: Method readDouble() not found in class java.io.BufferedReader.
double d=br.readDouble();
^
1 error

I am getting this error .I have again write out a simple program in this form.

Now tell me why i can not use br.readDouble()
jaideep
[I added UBB CODE tags to your source code to make it more readable. Please try to use
them in the future. Learn more about UBB codes here - Ajith ]

[This message has been edited by Ajith Kallambella (edited September 27, 2000).]
import java.awt.*;
import java.io.*;
public class mframe extends Frame{
Button bn,bs,be,bw,bc;
public mframe(){
super("maha");
Button bn = new Button("North");
Button bs = new Button("South");
Button be = new Button("East");
Button bw = new Button("West");
Button bc = new Button("Center");
setLayout(new FlowLayout());
//add(bn); add(bs); add(be); add(bn); add(bn);}

try{
add("North",bn);

setSize(300,300);
setVisible(true);
System.out.println("Added north and sleepling");
Thread.sleep(2000);
add("East",be);
setSize(300,300);
setVisible(true);
System.out.println("Added East and sleepling"); Thread.sleep(2000);
add("South",bn);
setSize(300,300);
setVisible(true);
System.out.println("Added South and sleepling"); Thread.sleep(2000);
add("West",bw);
setSize(300,300);
setVisible(true);
System.out.println("Added West and sleepling"); Thread.sleep(2000);
add("Center",bc);
setSize(300,300);
setVisible(true);
System.out.println("Added Center and sleepling"); Thread.sleep(2000);}
//catch(InterruptedException e) {}
}
public static void main(String args[]){

new mframe();
} }
import java.awt.*;
import java.io.*;
public class mframe1 extends Frame{
Button bn,bs,be,bw,bc;
public mframe1(){
super("maha");
Button bn = new Button("North");
Button bs = new Button("South");
Button be = new Button("East");
Button bw = new Button("West");
Button bc = new Button("Center");
setLayout(new FlowLayout());
add(bn); add(bs); add(be); add(bn); add(bn);}


public static void main(String args[]){

new mframe1();
} }
/*
here nothing happens untill I store new mframe1() object is frame f object and call f.show().
frame f=new mframe1();
f.show();
please explain it to me.Is it due to layout as in border layout I don't have to add f.show.
*/
jaideep
21 years ago
Replace return a new string .In the code
class aja{
public static void main(String[] args){
if("String".replace('t','t') =="String")
System.out.println("Equal");
else
System.out.println("Not Equal");
}
}
what I know is equals checks the value in object refernce whereas == checks the reference of the object.
class aja{
public static void main(String[] args){
if("String".replace('t','t') .equals("String"))
System.out.println("Equal");
else
System.out.println("Not Equal");
}
}

why first code is returning equal.Please correct me.
jaideep
Please also include me in the list.
my e-mail id is jaideeplk@satyam.net.in
jaideep
InputStreamReader is a class which converts bytes to char or could be said as byte reader .
you cannot give character stream in place of byte stream in InputStreamReader
A)new InputStreamReader(new FileInputStream("data"));byte stream so true
B)new InputStreamReader(new FileReader("data"));//character stream so false
C)new InputStreamReader(new BufferedReader("data"));character stream so false
D)new InputStreamReader("data"); //D:\mycode>javac BRead.java
BRead.java:6: Incompatible type for constructor. Can't convert java.lang.String
to java.io.InputStream.
BufferedReader br= new BufferedReader(new InputStreamReader("data"));
^
1 error
E)new InputStreamReader(System.in);//System.in is in a form of bytes. so true

A,E are tue
InputStreamReader is a class which converts bytes to char or could be said as byte reader .
you cannot give character stream in place of byte stream in InputStreamReader
A)new InputStreamReader(new FileInputStream("data"));byte stream so true
B)new InputStreamReader(new FileReader("data"));//character stream so false
C)new InputStreamReader(new BufferedReader("data"));character stream so false
D)new InputStreamReader("data"); //D:\mycode>javac BRead.java
BRead.java:6: Incompatible type for constructor. Can't convert java.lang.String
to java.io.InputStream.
BufferedReader br= new BufferedReader(new InputStreamReader("data"));
^
1 error
E)new InputStreamReader(System.in);//System.in is in a form of bytes. so true

A,E are tue