Click here to Skip to main content
16,006,749 members
Home / Discussions / Java
   

Java

 
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 
Actually non-static members are accessed via an object. An static member function can access non-static member of it's class also but through an oject... like--

class TestClass{<br />
	<br />
	int i_m_belongs_to_an_object_of_TestClass; // non-static data member<br />
	<br />
	static int i_m_belongs_to_TestClass;      // static data member<br />
	<br />
	public static void function(){<br />
		// i_m_belongs_to_an_object_of_TestClass = 0; // wont compile<br />
		i_m_belongs_to_TestClass = 0;<br />
		<br />
		TestClass obj = new TestClass();<br />
		obj.i_m_belongs_to_an_object_of_TestClass = 0; // will compiled but accessed through object<br />
		<br />
		OtherClass objOther = new OtherClass();<br />
		objOther.i_m_belongs_to_an_object_of_OtherClass = 0; // will compiled but accessed through object<br />
		<br />
		int someInt = OtherClass.i_m_belongs_to_OtherClass;  // accessed through Class name can also be accessed by an object<br />
	}<br />
}<br />
<br />
class OtherClass<br />
{<br />
	int i_m_belongs_to_an_object_of_OtherClass;  // non-static data member<br />
	<br />
	static int i_m_belongs_to_OtherClass;      // static data member<br />
}code><br />
<br />
Only one copy is allocated for static data members, one copy per object for non-static data members

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 
GeneralRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:30
David Skelly7-Jul-11 22:30 
GeneralRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 22:42
TorstenH.7-Jul-11 22:42 
AnswerRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:28
David Skelly7-Jul-11 22:28 
GeneralRe: Problem in Multithreading ,,.... Pin
gateway237-Jul-11 23:07
gateway237-Jul-11 23:07 
AnswerRe: Problem in Multithreading ,,.... Pin
Ashish Tyagi 4013-Jul-11 7:04
Ashish Tyagi 4013-Jul-11 7:04 
QuestionLoadin page while transferring control from one jsp to another jsp Pin
yog.khopade6-Jul-11 23:31
yog.khopade6-Jul-11 23:31 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
TorstenH.7-Jul-11 19:33
TorstenH.7-Jul-11 19:33 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
Richard MacCutchan7-Jul-11 23:08
mveRichard MacCutchan7-Jul-11 23:08 
QuestionUnchecked casting? Pin
Neo101016-Jul-11 22:03
Neo101016-Jul-11 22:03 
AnswerRe: Unchecked casting? Pin
David Skelly6-Jul-11 22:30
David Skelly6-Jul-11 22:30 
QuestionNEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. [modified] Pin
Member 80110535-Jul-11 23:16
Member 80110535-Jul-11 23:16 
AnswerRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Richard MacCutchan6-Jul-11 0:39
mveRichard MacCutchan6-Jul-11 0:39 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Member 80110536-Jul-11 2:57
Member 80110536-Jul-11 2:57 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Richard MacCutchan6-Jul-11 3:26
mveRichard MacCutchan6-Jul-11 3:26 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Member 80110536-Jul-11 3:31
Member 80110536-Jul-11 3:31 

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.