Update AComponent.java

Added and compressed the code