Just wanted to make a few suggestions. Because I do have some background knowledge of Java, I was able to see a couple of syntax errors you may want to revise. In both the Encapsulation and the Inheritance coding.
=) Other than that, I LOVE ROSEINDIA.NET!
Sir/ madam,
I found a fault in the program of Inheritance demo. Please take a look into the snippet:
----
class A{
public void fun1(int x){
System.out.println("The value of x is: " +x);
}
}
class B extends A{
public void fun2(int x, int y){
fun1(13);
System.out.println("The value of x and y is:" + x+ "\t" + y);
}
}
public class Inherit{
public static void main(String[] args){
B b = new B();
b.fun2(11, 13);
}
}
/*
Output:
----
e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java>javac Inherit.java
e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java>java Inherit
The value of x is: 13
The value of x and y is:11 13
e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java>
----
*/
Problem: After creating the Instance variable of Class B, you tried to invoke the function "fun2(int, int)" by using one argument only rather than using the 2 argument.
Please rectify this.
Thank you very much.
Thanks & Regards,
Prashant Kumar Jha.
----
Learn JavaSanjay Gund April 14, 2011 at 11:45 AM
Dear Sir, plz Teach me java
corrections to postsIyuanna June 24, 2011 at 1:48 AM
Just wanted to make a few suggestions. Because I do have some background knowledge of Java, I was able to see a couple of syntax errors you may want to revise. In both the Encapsulation and the Inheritance coding. =) Other than that, I LOVE ROSEINDIA.NET!
helpajay July 5, 2011 at 11:18 PM
i want to learn java in-depth. please tell me how to start reading java and tell me the important concepts in java.
helpajay July 5, 2011 at 11:19 PM
i want to learn java in-depth. please tell me how to start reading java and tell me important concepts in java
Regarding the example in Inheritance topicPrashant Kumar Jha September 23, 2011 at 4:02 PM
Sir/ madam, I found a fault in the program of Inheritance demo. Please take a look into the snippet: ---- class A{ public void fun1(int x){ System.out.println("The value of x is: " +x); } } class B extends A{ public void fun2(int x, int y){ fun1(13); System.out.println("The value of x and y is:" + x+ "\t" + y); } } public class Inherit{ public static void main(String[] args){ B b = new B(); b.fun2(11, 13); } } /* Output: ---- e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java>javac Inherit.java e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java>java Inherit The value of x is: 13 The value of x and y is:11 13 e:\Study_ Materials\Java_Programs\Own' s programs\Basic_Java> ---- */ Problem: After creating the Instance variable of Class B, you tried to invoke the function "fun2(int, int)" by using one argument only rather than using the 2 argument. Please rectify this. Thank you very much. Thanks & Regards, Prashant Kumar Jha. ----
cmnt on Object Oriented Conceptveeragovindu January 7, 2012 at 10:44 PM
Is Java 100% pure Object Oriented language r not? give me the brief explanation
javaRanjan Pandey March 10, 2012 at 3:42 PM
notes
oops aman kesarwani August 21, 2012 at 12:06 AM
what is linked assosiation,agregation and garnalization?
java core examplesdebbie November 23, 2012 at 8:19 AM
hi i am new to java by reading some examples it is really help ful please provide some simple steps for the freshers
Post your Comment