|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

05-13-2008, 12:22 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 512
|
|
|
Correct.... unsafe accessing....
If it is not a static, null exception occured.
Null.greet is a static method..........
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-13-2008, 12:31 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
|
Ah, it's remember to me.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-13-2008, 12:34 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
Sorry Eranga, but i am not getting you!!
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-13-2008, 12:42 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
What I'm saying is just without testing on an IDE, try to figure out the answer using what I have remember. It's work. Really nice to see that pal.
Oh, I love this thread. 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-13-2008, 12:47 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
Eclipse says,
The static method ehem() from the type Null should be accessed in a static way
albeit answer is what you already said 
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-13-2008, 12:51 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
|
Wow, Eclipse give that much of explanation. ;(
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:29 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
Here is the next quiz,
What is the output of following code. (No testing before answer
for( ; ;) {
System.out.println("Eranga");
}
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:35 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
damn sure, it will go infinite for C, but in JAVA
should not compile, we need a boolean expression in 2nd place in For
for ( ; boolean_expression_here ; )
i guess, so?
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-15-2008, 01:36 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
Anyone wants to try? 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:43 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
|
Ok, it's not only in C. Give an infinite loop for Java as well.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:45 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
easy questions should not be posted here 
there should be some catches  , after all it is a quiz section 
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-15-2008, 01:47 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
You think it's easy? One my friend repeat the exam because of this. 
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:49 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
|
which xam u r talkin abt?
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-15-2008, 01:53 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
|
University second year exam. We have to learn OOP on Java. At the final paper we got this as a one statement of a sample code. My friend don't know this gives a infinite loop, think there is a compile error. He lost 15 marks.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|

05-15-2008, 01:55 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
fifteeen maarks for dis quest  lol
r u SCJP ?
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-15-2008, 08:54 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 512
|
|
Same rule,
If this is not a compilable code, why?
If this is, what's the output?
public class test extends B{
public test(){
this.printA();
this.printB();
}
public static void main(String args[]){
new test().printA();
}
}
abstract class B extends A{
public void printA(){
System.out.println("class B");
}
}
abstract class A{
public void printB(){
System.out.println("class A");
}
}
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by sukatoa : 05-15-2008 at 08:58 PM.
|
|

05-15-2008, 09:12 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
|
|
|
class B
class A
class B
????
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
|
|

05-15-2008, 09:16 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 22
|
|
*IF* it's compilable, the output would be EDIT: Looked at it again, changed my code, you trickster...
But I think the compiler would complain that "Class B cannot be found" or something to that effect.
Last edited by Jesdisciple : 05-16-2008 at 03:55 AM.
|
|

05-16-2008, 04:35 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 179
|
|
|
class A
^_^
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

05-16-2008, 04:50 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 2,532
|
|
I agreed with Rakesh.
First two lines from the constructor call. Then from the main method.
Did you found any unsecured thing here in that code?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on July 27, 2008)
|
|
|