How to access sub class member using super class object

Ads
 

How to access sub class member using super class object

class A{ } class B extends A{ int b=1; } class Test{ public static void main(String args[]) { what to do here to access sub class variable b using super class object

} }

View Answers

Ads









Related Tutorials/Questions & Answers:
How to access sub class member using super class object
How to access sub class member using super class object  class A{ } class B extends A{ int b=1; } class Test{ public static void main(String args[]) { what to do here to access sub class variable b using super class object
super class
super class  which is the super base class in java
Advertisements
Explain final class, abstract class and super class.
Explain final class, abstract class and super class.  Explain final class, abstract class and super class.   Explain final class, abstract class and super class. A final class cannot be extended. A final class
Sub-class in java
a super class and subclass definition and achieved through the object creation... Sub-class in java      ... class and subclass. -- Inheritance allows a new class known as the sub-class
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
which class is super class to all classes
which class is super class to all classes  in java which class is super class to all classes   Object is the super class for all user defined and predefined class.   java.lang.Object is the supper class of all
What is a local, member and a class variable?
What is a local, member and a class variable?   Hi, What is a local, member and a class variable? thanks
how to get session object in simple java class??
how to get session object in simple java class??  i am fallowing a simple mvc architecture. actually my problem is.... i am using 4 classes in my... into session. so, please tell me, how to get the session object (GroupPojo) in a simple
What does it mean that a class or member is final?
What does it mean that a class or member is final?   hi, What does it mean that a class or member is final? Thanks
Limit the Class Object Creation
Limit the Class Object Creation In this section you will learn about how a class object creation can be a restricted to a fix number of times... to restrict the object creation of a class. This is a simple code in Java where I have
how to access the object of one frame on clicking a button without using this keyword
how to access the object of one frame on clicking a button without using this keyword  import java.awt.*; import java.awt.event.*; class Mybuttons1...) { System.exit(0); } }); } } class Myclass extends Frame implements
Does memory for Class or Object?
Does memory for Class or Object?   Does memory for class(methods & instance variables)allocated without it's object creation?If no,then The main() itself has associated with a class for which there is no instance creation,how
Object class in java
Object class in java  want an example and with an explaination about equals() method in object class? Is equals() is similar
Inheritance in Java
. Inheritance allows access of properties and methods of super class by a sub class... (OOPS) defines a general class and establishes a subtype from an existing object... a subclass is derived from parent class. There is only a sub class and it's parent
Random Access File class
Random Access File class  Write a short note on Random Access File class.   Please visit the following link: Java Random Access File
Sub class of a previous java program
Sub class of a previous java program  Create a Faculty subclass...). Provide suitable constructors for your classes. Each of these sub classes must have... to the Employee base class that simply outputs a message ?Cannot change this Employee?s status
can we use scanner class,class , object and methods to get output without using constructor ????
can we use scanner class,class , object and methods to get output without using constructor ????  im getting error here..i hav used scanner class... am i getting error here... can we get output using scanner class , object
Access Modifiers
and accessibility of a class, member variables and methods. Java provides... makes a member of the class available to all classes in the same package and all sub classes of the class.     default
Super keyword in java
of the super class method ,then we can invoke the super class method using.... In super class In sub class Super is also used to call super class... : While calling super class constructor in sub class, super() should be the first
how to set class path
how to set class path  how to set class path in java
Class
Class, Object and Methods     ... class. Object is the feature of a class which is used for the working... and implementation of the object, Inheritance etc. In this Program you will see how to use
Member Classes
; The class defined in the body of a class is called a member class. Member classes can also use instances of the same class without explicit... of a member class
Object Class Methods in Java
of the object class java.lang.Object. How to declare notify method are:- public final... a class object. How to use getClass() method are:- void PrintClassName...We are going to discus about Object Class Methods in Java
Can you create an object of an abstract class?
Can you create an object of an abstract class?   Hi, Can you create an object of an abstract class? Thanks
error cannot access class com.opensymphony.xwork2.ActionContext, wrong version
error cannot access class com.opensymphony.xwork2.ActionContext, wrong version  Error(1,32): cannot access class com.opensymphony.xwork2.ActionContext; class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0
How to create a class in java
How to create a class in java  I am a beginner in programming and tried to learn how to do programming in Java. Friends please explain how can I create a class in Java
class
class  can any body give me idea how to write code for Country.java is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator
how to use string of one class into another Class
how to use string of one class into another Class  I created textField(JTextField t1=new JTextField();(it is in ClassA. The input of this textField i.e t1.getText() is to be used in different(another Class say in ClassB. How can
new operator for creating the object of inner class
new operator for creating the object of inner class  Hi , The folliowing is my code : class Outer { class Inner{ void show... "); } } } class Test { public statis void main(String args
what is the working of JVM when An object is created of a class?
what is the working of JVM when An object is created of a class?  what is the working of JVM when An object is created of a class?   When the JVM creates the instance of your class object,the object instance is stored

Ads