Click here to Skip to main content
15,915,093 members
Home / Discussions / Java
   

Java

 
GeneralRe: Could not find main class Pin
RossouwDB11-Jul-11 3:12
RossouwDB11-Jul-11 3:12 
GeneralRe: Could not find main class Pin
TorstenH.11-Jul-11 3:13
TorstenH.11-Jul-11 3:13 
GeneralRe: Could not find main class Pin
Richard MacCutchan11-Jul-11 4:53
mveRichard MacCutchan11-Jul-11 4:53 
GeneralRe: Could not find main class Pin
RossouwDB11-Jul-11 19:19
RossouwDB11-Jul-11 19:19 
GeneralRe: Could not find main class Pin
TorstenH.11-Jul-11 21:10
TorstenH.11-Jul-11 21:10 
GeneralRe: Could not find main class Pin
RossouwDB11-Jul-11 21:25
RossouwDB11-Jul-11 21:25 
GeneralRe: Could not find main class Pin
TorstenH.12-Jul-11 0:03
TorstenH.12-Jul-11 0:03 
QuestionPolymorphism problem in java.. Pin
gateway239-Jul-11 6:21
gateway239-Jul-11 6:21 
When we assign a subclass object to its superclass reference then the superclass reference can only access the methods that are in the superclass, it can't even the aceess its overridden methods in subclass.


if the above lines are true then how the following code can works ...





class a
{
int x;
void show()
{

System.out.println(x);

}
}


class b extends a
{
void show()
{
System.out.println("in subclass");
}

void show2()
{
System.out.println("in show2");
}

}


class Main
{
public static void main(String args[])
{
b bRef=new b();
a aRef=new b(); // why this line prints "in subclass". How a reference access the subclass?
aRef.show();

bRef.show2();

}

}
AnswerRe: Polymorphism problem in java.. Pin
Richard MacCutchan10-Jul-11 5:43
mveRichard MacCutchan10-Jul-11 5:43 
AnswerRe: Polymorphism problem in java.. Pin
jschell10-Jul-11 12:53
jschell10-Jul-11 12:53 
AnswerRe: Polymorphism problem in java.. Pin
Shameel10-Jul-11 22:47
professionalShameel10-Jul-11 22:47 
GeneralRe: Polymorphism problem in java.. Pin
jschell12-Jul-11 10:11
jschell12-Jul-11 10:11 
GeneralRe: Polymorphism problem in java.. Pin
Shameel12-Jul-11 19:10
professionalShameel12-Jul-11 19:10 
GeneralRe: Polymorphism problem in java.. Pin
Richard MacCutchan12-Jul-11 23:16
mveRichard MacCutchan12-Jul-11 23:16 
GeneralRe: Polymorphism problem in java.. Pin
Shameel12-Jul-11 23:53
professionalShameel12-Jul-11 23:53 
AnswerRe: Polymorphism problem in java.. Pin
Ashish Tyagi 4012-Jul-11 4:46
Ashish Tyagi 4012-Jul-11 4:46 
Questionstatic keyword problem..... Pin
gateway237-Jul-11 20:54
gateway237-Jul-11 20:54 
AnswerRe: static keyword problem..... Pin
TorstenH.7-Jul-11 21:46
TorstenH.7-Jul-11 21:46 
GeneralRe: static keyword problem..... Pin
David Skelly7-Jul-11 22:53
David Skelly7-Jul-11 22:53 
GeneralRe: static keyword problem..... Pin
TorstenH.7-Jul-11 23:02
TorstenH.7-Jul-11 23:02 
AnswerRe: static keyword problem..... Pin
jschell8-Jul-11 12:18
jschell8-Jul-11 12:18 
AnswerRe: static keyword problem..... Pin
Shameel10-Jul-11 22:53
professionalShameel10-Jul-11 22:53 
AnswerRe: static keyword problem..... Pin
Ashish Tyagi 4013-Jul-11 6:25
Ashish Tyagi 4013-Jul-11 6:25 
QuestionProblem in Multithreading ,,.... Pin
gateway237-Jul-11 17:47
gateway237-Jul-11 17:47 
AnswerRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 19:34
TorstenH.7-Jul-11 19:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.