Deepak B

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

Recent posts by Deepak B

Hi mainsh,deep
I am regular visitor of java ranch site, I have observe that most of people suggest to buy J@Whiz mock exam tools,
is it means that u can pass SCJP2 exam only when u purchase and solve this tools mock,
I am also going to give exam on 30 OCT ,
it means that there is no use use of other mock exams available in Javaranch site ,
can any one suggest me which mock exams are good ,
I am very confused plz solve my query.
Thnx in advance
Deepak
Hi friends
Constructor can not be overriden but That can be overloaded in a class.
like
class A
{
A(){}
A(int c){}
A(int c,char p){}
}
class B extends A{
B{int p){}
B(int c,chat q){}
}


Ya Payal you absolutely correct because there is no object is create only when u create string using new String that will create String object so answer is 0

Thnx
Kaspar james Bhaskar

Dear friends
I am trying to make chat server application but I am facing problem �
How can pass a user name(string) to server .
I made a client socket with make a TCP/IP connection to server using
Socket s=new socket(host , port);
Actually my aim is to broadcast username to all user who currently login..Means as user login message will be display on the screen like �Denial has joined Room� here Denial is user name it may be differ .. Another thing is that I want to online user list in to applet that is only possible when I get username when new client connect to server.
I tried all the client socket option��plz help its urgent �.
Thnx in advance �
Deep
Dear Friends
Read this Code ..This is Question from jtips Mock exams
class Test {
Test() {
System.out.println("Super");
}
static {
System.out.println("Superclass - Static Initializer");
}
}
public class MQ1 extends java.lang.Object {
public static void main(String [] args)
{
MQ1 test = new MQ1("Java");
System.out.println("In Main method");
}
static {
System.out.println("Subclass - Static Initializer");
}
MQ1(String s) {
System.out.println(s);
}
}
Ans is

Subclass - Static Initializer
Java
In Main method
how??? becouse static block initialize when class is loaded static method or static block or static variable not a member variable of any class so they should execute according to their order .......
according to me answer should be
Superclass - Static Initializer
Subclass - Static Initializer
Java
In Main method
Can any one explaine me why this is not true......
Thnx in advance
public static void main (String args[]) method is static method and execute and execute first when class is loaded ..... in that situation class doesn't get value of variable val ......
for solution of this problem either u can make val variable is a static our create a object of class in to main method then
Object Name.variable name

Read Qustion
public class Star {
Star() {
System.out.println("Star");
}
Star(String s1) {
super();
System.out.println(s1 + " is a Star");
}
Star(String s2, String s3) {
this("Mercury");
System.out.println( s2 + " and " + s3 + " are also Stars");
}
public static void main(String [] args) {
Sun sun = new Sun();
Sun sun1 = new Sun("Venus");
Sun sun2 = new Sun("Mars", "Earth");
}
}
class Sun extends Star {
public Sun() {
System.out.println("Star Wars1");
}
public Sun(String v1) {
super(v1, "Saturn");
System.out.println("Star Wars2");
}
public Sun(String v2, String v3) {
if ( v2.substring(0, v2.length()).length() > v3.length())
System.out.println("Mission to Mars");
else
System.out.println("Earth");
}
}

answer are
Star
Star Wars1
Mercury is a Star
Venus and Saturn are also Stars
Star Wars2
Star ///////////// Problem.with this star..
Earth
My Qustion is ???
When u call Overloaded consutructor with two parameter HOW ..
Second Star will be printed....

Thnx
Dear friends
Read this code
public class Hmm extends Thread
{
public void run()
{
System.out.println("Before start method");
this.stop();
System.out.println("After stop method");
}
public static void main(String[] args)
{
Hmm a = new Hmm();
a.start();
}
}
What should be output of this code???
i got compile time error that
"hmm.java uses our overrides deprecated API. Recompile with "-deprication"
any one can explain me why this error is coming when i complie this code , and ` what should be proper method to execute this code
Thnx



Dear friends
"this" keyword implicitly include with every object. Whenever many object of one class is created each object contain his own copy of variable, method, using �this� u can identify which method or which class variable is used ,Static variable doesn�t belong to any class ,static variable execute before class constructor is called, it is in depended keyword, That�s way u can�t bound �this� keyword with any class method or variable or object ,
Dear vikinsa
The solution u r givan for ritu problem will work with small amount of data but when u are acsseing huge data (may be 50000 or more than that) then u can't store data in to vector or collction, so how can i display records page by page.With ResultSet.

Thnx
23 years ago
hello Divyajot
Thnx for help , i really need help for execute record page by page , But solution your are talking That Used MySQL Database ,t I tried maney ResultSet Methods doesn't work with MS SQL 7.0, like as u said
/******************************
SELECT * from tablename where 1 LIMIT 3, 10
here we are picking 10 records starting from the 3rd.
/********************************************
This dosen't work with MSSQL 7.0 so can u give me any other solution for this

Thnx
Deepak

23 years ago
Thnx parmeet
but , its huge database ,may be 500000 or more record, i want to display records. in the first page it has first 10 records, next page has next 10 records and so on.. page: 1 2 3 4 5 6 7 8 9 10 (page no)
Note : Data base is growing 1000 record every day so not possible to used any of collection or vector java class..
is there any method which directly retrive data from table and through java code in JSP page , i can divide that in to 10 record per page .

Thnx in advance
Deepak
thru java server pages(JSP), its huge database ,may be 500000 or more record, i want to display records. in the first page it has first 10 records, next page has next 10 records and so on.. page: 1 2 3 4 5 6 7 8 9 10 (page no) when i select 1, it will show 1st page of first 10 records,if i select 2 it will show 2nd page of records starts from 11 to records 20 ... and so on.....
my back end is: MSSQL 7.0
Note : Data base is growing 1000 record every day so not possible to used any of collection or vector class..
is there any method which directly retrive data from and trough jsp page i can divide that in to 10 record per page
Deepak