I have 2 classes Summary and Main. in main class i have one button and i want to call the summary class on the click event of main class button becauuse my summary class contain the gui
inheritancepraveen jindal January 18, 2012 at 11:59 AM
class A {
int x;
int y;
int get(int p, int q){
x=p; y=q; return(0);
}
void Show(){
System.out.println(x);
}
}
class B extends A{
public static void main(String args[]){
A a = new A();
a.get(5,6);
a.Show();
}
}
without method. how to find result? like....
interface A{
int i=20;
void show();
void test();
void display();
}
class B implements A
{
void show()
{
s.o.p("show");
s.o.p("how are you");
}
void test()
{
s.o.p("test");
}
void display()
{
s.o.p("display");
}
}
please send the result of this. it has been urgent
class A
{
int x;
int y;
void get(int p, int q)
{
x=p; y=q;
}
void Show()
{
System.out.println(x);
System.out.println(y);
}
}
//B derived from class A
class B extends A
{
void display()
{
System.out.println("B");
}
public static void main(String args[])
{
B a = new B(); //Created object a from child class B
a.get(5,6);
a.Show();
a.display();
}
}
javaimran April 9, 2011 at 9:13 PM
it is very helpful site for students.so improve our knowledge.
inheretancesajidaqumer April 11, 2011 at 4:39 PM
so interisting
Basics in InharitanceBuyisile April 19, 2011 at 10:53 PM
I need help with the basics of inheritace.
javasunil kumar April 21, 2011 at 5:17 PM
how can we achieveb the runtime polmorphism by using the virtual functtions in java
hi like roseindia.net siteNeha gupta June 2, 2011 at 9:17 PM
I am very happy to see this site is very useful in our study it provide us very good study material with great example
i like this siteNeha gupta June 2, 2011 at 9:22 PM
It is very good site for help us in our studies & provide us very good matter with great example
javaRohit Prakashan July 3, 2011 at 8:58 PM
If we want to call the default constructor then we pass the empty parameter list. in inheritance pls explain by using program...........
InheritanceKumar Raja August 20, 2011 at 11:12 PM
A big thankyou to roseindia who provides the such a best tutorial with a suitable example... Regards Kumar Raja, Patna(Parsa)
core javaRama Deokate September 9, 2011 at 5:58 AM
Core java is a super language...
View Size Of Java VariableRaju K. Darji September 27, 2011 at 1:33 PM
How can we find the size of particular variable or class? Like we use sizeof operator in c++ to find the size of variable.
Thanx deepak October 10, 2011 at 12:28 AM
M greatly thanking to this site is quite helpful for the students like me studying last nite b4 the exams thanx a lot......
sirsudha November 1, 2011 at 5:14 PM
sir pls send the information about inheritance concept,benifts of inheritance,super&sub classes........
FeedbackPriya and Sakthi November 21, 2011 at 12:37 PM
Dont use extends keyword in Main class
inheritancesindhu December 15, 2011 at 5:47 PM
i want more details.plz give me sir.
javabhurani December 20, 2011 at 6:10 PM
it is very helpful to our referrence
QuestionDevendra December 27, 2011 at 3:37 AM
I have 2 classes Summary and Main. in main class i have one button and i want to call the summary class on the click event of main class button becauuse my summary class contain the gui
inheritancepraveen jindal January 18, 2012 at 11:59 AM
class A { int x; int y; int get(int p, int q){ x=p; y=q; return(0); } void Show(){ System.out.println(x); } } class B extends A{ public static void main(String args[]){ A a = new A(); a.get(5,6); a.Show(); } }
encapsulationafif lami January 28, 2012 at 4:38 PM
good
java programmingmurugan.D January 31, 2012 at 1:44 PM
simple program exercise
javasandeep January 31, 2012 at 5:21 PM
good...............
javaA.NARESH February 3, 2012 at 12:03 PM
in constructors concept what is use of this keyword and with more example programs
LikeMSelvam February 20, 2012 at 3:04 PM
I Liked It Nice To learn.........
javasuvabrata saha February 27, 2012 at 8:57 PM
plz send me an example of multiple inheritance
javacharu thakral March 6, 2012 at 7:35 PM
good
javaPushkar March 8, 2012 at 6:06 PM
Good Examplation
complete java languageAshish March 10, 2012 at 4:52 PM
i want to learn complete java...............
javaAmit kumar yadav March 20, 2012 at 10:59 PM
what can we say that java is fully secured? prove it briefly.
javaanuj poonia April 3, 2012 at 4:15 PM
what is the defferenc between this and super keyward
javasitu April 8, 2012 at 8:48 PM
well describe
javaSHETE PRATHMESH PRAKASH April 19, 2012 at 3:02 PM
nice explanation
javaManohar kumar Bishwas May 17, 2012 at 3:43 PM
about inheratance
generalSrimoyi Kundu May 27, 2012 at 11:40 PM
Rosevalley is the best tutorial website for JAVA. I have read all the topics from this website for my BCA Final year exam.... Thanks a ton
some errors during compileajit June 3, 2012 at 5:15 PM
C:\Users\patra>cd desktop C:\Users\patra\Desktop>javac A.java A.java:1: class, interface, or enum expected lass A{ ^ A.java:3: class, interface, or enum expected float b; ^ A.java:4: class, interface, or enum expected void Show(){ ^ A.java:6: class, interface, or enum expected } ^ 4 errors
java, inheritance and interfacegeethesh babu June 10, 2012 at 8:02 AM
without method. how to find result? like.... interface A{ int i=20; void show(); void test(); void display(); } class B implements A { void show() { s.o.p("show"); s.o.p("how are you"); } void test() { s.o.p("test"); } void display() { s.o.p("display"); } } please send the result of this. it has been urgent
sample codingsmohan June 21, 2012 at 1:43 PM
i want some java sample coding in all topics
multiple inheritanceSAGAR BANARASE June 26, 2012 at 7:04 PM
multiple inheritances not used in directly in java
Java arithmeticsErick Ouko July 10, 2012 at 11:05 AM
I like the way inheritance has been explained, can I get to know more in Method overloading and Method Overriding?
doubtshakhtivel July 17, 2012 at 10:34 PM
put output for all progms
inheritance in java and typeskarthigairani s July 22, 2012 at 5:39 PM
Its very useful of the Engg Students.
bloodgem July 23, 2012 at 3:52 PM
nice one
nicemurugavel August 2, 2012 at 11:45 AM
very useful.thanks
inheritancekhilendra August 25, 2012 at 6:00 PM
helpful the all the details.
c++anuragsinha September 14, 2012 at 12:26 PM
hi you help me c++ facebook id =>anuragsinha1989@gmail.com
rushik sutariyarushik sutariya October 3, 2012 at 2:54 PM
which is the easy and better JAVA or PHP?
noniro October 3, 2012 at 5:24 PM
no
Error inheritanceyousuf khan October 7, 2012 at 3:58 PM
Error: Could not find or load main class B
Error inheritanceyousuf khan October 7, 2012 at 3:59 PM
Error: Could not find or load main class B
javamotilal giri $ sagarika November 7, 2012 at 12:58 PM
easy to understand for student
inherirtancepk November 27, 2012 at 10:03 AM
good
InheritanceAjin Joy December 3, 2012 at 3:58 PM
This is very simple and good concept of inheritance with suitable example. But Why don't java supports Other types of inheritance like c++ ?
Simple InheritanceAjin Joy December 5, 2012 at 2:53 PM
class A { int x; int y; void get(int p, int q) { x=p; y=q; } void Show() { System.out.println(x); System.out.println(y); } } //B derived from class A class B extends A { void display() { System.out.println("B"); } public static void main(String args[]) { B a = new B(); //Created object a from child class B a.get(5,6); a.Show(); a.display(); } }
easy example of inheritenceniketh July 9, 2011 at 11:51 AM
class Sample extends Demo { public void test() { System.out.println("Hello"); } public static void main(String[] arg) { Sample s=new Sample(); s.test(); s.add(); } } class Demo { public void add() { System.out.println("Add Method"); } }
Post your Comment