Win a copy of Rust Web Development this week in the Other Languages forum!

Netla Reddy

Greenhorn
+ Follow
since Jun 18, 2000
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 Netla Reddy

Hi,
Answer 'B' is correct.Inner classes can be delcared as Static.If inner class is declared as Static it is as good as top level clsass.

Congrats Usha !!!
Netla Reddy

Please could you some body give the answer.?
Question 28)
What will happen when you attempt to compile and run the following code
public class As{
int i = 10;
int j;
char z= 1;
boolean b;
public static void main(String argv[]){
As a = new As();
a.amethod();
}
public void amethod(){
System.out.println(j);
System.out.println(b);
}
}
1) Compilation succeeds and at run time an output of 0 and false
2) Compilation succeeds and at run time an output of 0 and true
3) Compile time error b is not initialised
4) Compile time error z must be assigned a char value

Given Ans is 1:
But I belive that answer is 4;
Thanks in advance
But when I tried to compile this is giving a problem
Please Help
21 years ago
Please could you some body give the answer.?

Question 28)
What will happen when you attempt to compile and run the following code
public class As{
int i = 10;
int j;
char z= 1;
boolean b;
public static void main(String argv[]){
As a = new As();
a.amethod();
}
public void amethod(){
System.out.println(j);
System.out.println(b);
}
}
1) Compilation succeeds and at run time an output of 0 and false
2) Compilation succeeds and at run time an output of 0 and true
3) Compile time error b is not initialised
4) Compile time error z must be assigned a char value

Given Ans is 1:
But I belive that answer is 4;
Thanks in advance
21 years ago
Dear All,
wait() method is not implimented in the in the thread class, It should implement in the in object class.
notify() will move only one thread form waiting to ready and notifyall () will move all waiting threads to Ready state
I hope it is clear......
Thanks

[This message has been edited by Netla Reddy (edited September 03, 2000).]
It is working for me
Hi All,
Polymorphism:One or more object act diferently for same message.
Take one real world example
Suppose one Car (Car Object) , one Cycle (One more object) are running on the road and they reached a signal and with red sign both object will stop.
Here both objects are stopped for one message but the mechanism is different.
I hope it is clear for you.............

Please notice that there are two types of Polymorphism Viz
1) Static Polymorphism and Dynamic Polymorphism or
2) True Polymorphism or False Polymorphism or
4) Compile Polymorphism or Runtime Polymorphism



Originally posted by teja nelluri:

hi everybody,
please tell me the answer for given below code
and explain how it comes.
thanks.
public class test
{
public static void main(String args[])
{
outer:for(int i = 0; i < 3; i++) <br /> for(int j = 3; j >= 0; j--) {
if(i == j) continue outer;
System.out.println(i + " " + j);
}
}
}
}


Hi Teja,
First check you code.It will give an compiler error.
Otherwise it works fine and it gives
0 3
0 2
0 1
1 3
1 2
2 3

Thanks

Hi,
I am using JDK 1.2 & WIN NT and it prints correct results for me ie.,
Infinity
-Infinity
-Infinity
Thanks
[This message has been edited by Netla Reddy (edited July 31, 2000).]
Hello ,
You genius guys are correct.I think this is very good example for Operator(+) overloding
Thanks
Hi,
What Aman is saying is correct.Second part will never be performed.
But I was wondering what Rahul is saying that His code is printing literal "first2".How will print it b'coz It returns false so it will not print immediate print statement.It will skip to next statement and it prints literal "Hello world"
Thanks
Netla

Originally posted by Rahul Mahindrakar:
Hi,
You are right in your answer
I enclose the program below to conform what i say.
class demo
{
public static void main(String[] args)
{
String s=null;
//System.out.println("first");
//if ((s != null) & (s.length()>0))
//System.out.println("first1");
if ((s != null) && (s.length()>0))
System.out.println("first2");
//if ((s != null) | (s.length()>0))
//System.out.println("first3");
//if ((s != null) | | (s.length()>0))
//System.out.println("first4");

System.out.println("Hello World!");
}
}
The program compiles sucessfully and at runtime prints out first2 sucessfully.
Regds.
Rahul.


[This message has been edited by Netla Reddy (edited July 31, 2000).]
[This message has been edited by Netla Reddy (edited July 31, 2000).]
Hi Nirmala,
Congratulation..........

Originally posted by Nirmala:
Hi all,
I cleared with 80%. Thanks to JavaRanchers. It was my energy to take my exam.Thank you all.It helped me 20%.
I will be here to grow with every one.
Exam was okay and straightforward except for some multi choice questions.
I too get one question about mediatracker.(Thanks to Tony).
2-about files.
2-gridbaglayout
7-fill in the blanks
lot of multi choice questions.
You must be strong in Java Fundamentals,to get it cleared.
Thank you all.
Nirmala


I wrote a program so that it can have hundreds of errors, and I compiled it.So JDK1.2 has displayed only one 100 errors (With explanation and line numbers)and it say this is the limit of errors it can display.
But it listed total number of errors.(Not the line numbers for all)
Please confirm is this happening with all versions.
Thanks
Netla

[This message has been edited by Netla Reddy (edited June 18, 2000).]
Dear All,
I tried with this code.I got same as Udayan was getting ,Like it is executing once and if you remove j+ = i statement it is in infinite loop;
I am using JDK 1.2 and Win NT.
Thanks
Netla
[This message has been edited by Netla Reddy (edited June 18, 2000).]