Kameshwar Prasad

Greenhorn
+ Follow
since Dec 04, 2007
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 Kameshwar Prasad

Hi friends,

To help, Thanks in advance.

I have a web page to select size using link, that has no href attribute. How will i click using httpunit? I am using this code But response showing size is not selected.

13 years ago
hi friends
i am facing a hard problem and i need your help, please help me.

Thanks in advance.

i am using htmlunit, junit to submit a webpage.
A form having some textfield, some combo boxs and one check box, after filling all these field i submit then i get exception, but this alway not occur at one place it may also occur when a new registration form is submitted


13 years ago
hi friends,
i am facing a hard problem and i need your help, please help me.

Thanks in advance.

i am using htmlunit to submit a webpage.
A form having some textfield, some combo boxs and one check box, after filling all these field i submit then i get exception, but this alway not occur at one place it may also occur when a new registration form is submitted.


Originally posted by eric moon:
Go get the together whiteboard. It's free, and you can just write your java code, and it generates UML (and vice-versa). It's a really good way to learn class diagrams, at least. I imported one of my more complex packages into it, and learned a lot from seeing UML of classes I already know very well.
HTH


what is whiteboard ?can you give site address ... thank you
sorry for not being clear .
making a report basing on the data avilable in the database using jsp and exporting data to an accounting package for further calculations(tab seperated for import into accounting package)
i know how to make report out of data base ..but want clarification for exporting data
21 years ago
what is exporting a report file ?exporting tab delimited data file ?how it is done ?
can any help me out
thanks in advance
21 years ago

Originally posted by Vroummmmm:
[B]In the code below what triggers my curiosity and my understanding is that the line tagged with Tag: produces q.y = 7 ?
Shape q = new SubShape();

in this reference when you are calling variable it will look into Shape ,but when you are calling method it looks into actual object referencing i.e SubShape .. so when you are calling q.any variable it will print variable of Shape ...if you call q.any method it will look into SubShape

the fallowing first example is from jxam or jargon the out put does not include " End processing " why ?
but second example from Khalid and Rolf example gives an out put which includes " Returning from division." which is at the same place as "End processing" of above example ?


first example :-
import java.io.*;
import java.net.*;

public class Base6{

private void test() {

try {
String a = null;
String b = null;
// Complex processing

if(a==null)
throw new MalformedURLException("test");
if(b ==null)
throw new EOFException("test");
// Complex processing

System.out.println("End of try block");

}
catch (MalformedURLException e) {
System.out.println("Caught MalformedURLException");
return;
}
catch (EOFException e) {
System.out.println("Caught EOFException");
return;
}

System.out.println("End processing");
}

static public void main(String[] a) {
new Base6().test();
}

}

// Select all valid answers
// a) End of try block
//corect ans b) Caught MalformedURLException
// c) Caught EOFException
// d) End processing
// e) None
second example from Khalid and Rolf :-
class DivisionByZeroException extends Exception {
DivisionByZeroException(String msg) { super(msg); }
}
public class DivisionByZero5 {
public void division() {
int num1 = 10;
int num2 = 0;
try { // (1)
if (num2 == 0) throw new DivisionByZeroException("/ by 0"); // (2)
System.out.println(num1 + " / " + num2 + " = " +
(num1 / num2)); // (3)
} catch (DivisionByZeroException e) { // (4)
System.out.println("Dealt with " + e);
} finally { // (5)
System.out.println("Finally done.");
}
System.out.println("Returning from division."); // (6)
}
public static void main(String args[]) {
new DivisionByZero5().division();
System.out.println("Returning from main."); // (7)
}
}
this is a question from Jargon test :-
in this when a and b are passed in swap method value of a changed by append and reflected in out put but value of b has not changed by b=a why ?
public class Test5 {
public static void main(String args[]) {
StringBuffer a = new StringBuffer("One");
StringBuffer b = new StringBuffer("Two");
Test5.swap(a,b);

System.out.println("a is "+ a +"\nb is " + b);
}
static void swap (StringBuffer a, StringBuffer b) {
a.append(" more");
b=a;
}
}
answer is one more and two
not one more one more
this is question from jawroski which says char = 1 byte how is it possible ?

here is the full code from jawroski quiz i am adding
How many bytes does the fallowing program write to temp.txt?
import java.io.*;
public class TestIOApp{
public static void main(String args{})throws IOException{
FileOutputStream outStream = new FileOutputStream("text.txt");
String s = "text";
for(int i =0 ;i<s.length();++i)>
outStream.write(s.charat(i));
outStream.close();
}
}
this is a question from jawroski quiz sentence construction may be slightly different
String s = "test" ;
System.out.prinln(s);
how many bytes did s have
ans he gave is 4 bytes
how come this as char is having 2 bytes it must be 8 bytes ?
here is the full code from jawroski quiz i am adding
How many bytes does the fallowing program write to temp.txt?
import java.io.*;
public class TestIOApp{
public static void main(String args{})throws IOException{
FileOutputStream outStream = new FileOutputStream("text.txt");
String s = "text";
for(int i =0 ;i<s.length();++i)>
outStream.write(s.charat(i));
outStream.close();
}
}
[This message has been edited by kameshwar (edited April 29, 2000).]
the fallowing code is from Jargon test (http://www.sarga.com)when this progra is being compiled giving

No constructor matching Base() found in class Base.
Child(int i) { test (); }
as there is no call for default base constructor in child class
why this error ?
<pre>

class Base
{
Base(int i) { test(); }
// Base(){}
void test() {
System.out.println("Base.test()");
}

}

public class Child extends Base {


byte b = 1 ;
Child(int i) { test (); }
Child(float f) { this ((int)f); }
void test() {
System.out.println("Child.test()");
}

static public void main(String[] a) {
new Child(10.8f).test();
}
}

</pre>

[This message has been edited by maha anna (edited April 23, 2000).]