java - Is there any performance or memory improvement between importing a class and using references with full class name? -


i'm wondering if there difference between following implementations:

import java.util.date;  public class simpledateprinter {      public void printdate() {         system.out.println(new date());     }  } 

... , ...

public class simpledateprinter {      public void printdate() {         system.out.println(new java.util.date());     }  } 

the reason ask because understanding c++ include statements contents of included file copied source file @ compile time. i'm unsure if import statements in java work in same way, if do, using second construction shown above possibly save memory (since not importing entire java.util.date class simpledateprinter? or irrelevant?

i realize writing code without ever importing class detrimental readability , whatnot. realize in example above it's "not enough worry about." i'm curious cases in performance crucial factor.

imports resolved @ compile time. in example, generated bytecode same. , @ runtime, class (date) need loaded in case. makes no difference performance perspective.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -