Does the object type known during compilation in Java?.

Does the object type known during compilation in Java?.

class A {

}

class B extends class A {

}

class checkType

{

public static void main(String[] args)

 {
   A ObjA = new B();/// Here ObjA is of type A--> this fact is  known at compile time.
                        But here ObjA is pointing to new B(). Will this be known at  
                        compile time or run time.
 }

}

View Answers

Ads









Related Tutorials/Questions & Answers:
Does the object type known during compilation in Java?.
Does memory for Class or Object?
Advertisements
Object does not support proprty or method
Unable to cast object of type 'Microsoft.Xrm.Sdk.OptionSetValue' to type 'System.String'
AttributeError: type object 'object' has no attribute 'dtype'
AttributeError: type object 'object' has no attribute 'dtype'
Method is undefined for the type Object(org.apache.jasper.JasperException)
java Compilation
java Compilation
java Compilation
compilation problem
compilation problem
Casting (Type Conversion)
compilation fail
compilation error
compilation errors
Convert Object to Int
object
Convert Object to Double
Java compilation error - Java Beginners
Main memory is also known as
java compilation error - Hibernate
command prompt is compilation is not working
noise during print screen
Java Compilation - Java Beginners
compilation error - Java Beginners
java is pure object oriented
Access Static Member Of The Class Through Object
object as argument
type casting
Type casting in java
Object in java - Java Beginners
java compilation error - Java Beginners
a problem during add jar file javax.annotation.Resource
Java type casting
Type Comparison Operator
What is Transient variable in Java
Java Object
Does hibernate support polymorphism?
package javax.ws.rs does not exist
Object
Error during runtime NoClassDefFound in java
Error during runtime NoClassDefFound in java
Bounded Type Parameters
type casting
An Overview of Java      Java is a programming language      Java is Object Oriented Programming
Java Compilation error. Hibernate code problem. Struts first example - Hibernate
package javax.servlet does not exist
object creation
Type casting

Ads