java


Why is the main method in superclass executed by JVM? [duplicate]


This question already has an answer here:
Are static methods inherited in Java?
11 answers
When I execute:
java B
for the following program, why does main of superclass A gets called? As I understand static methods belong to class level.
class A
{
public static void main(String[] args)
{
System.out.println("A.main");
}
}
class B extends A{ }
Static methods are inherited by subclasses.

Related Links

How to archive files revision-safe using java?
If I set “incompatible” transaction isolation level and lock mode, which takes precedence?
Guava SortedSetMultimap doesn't put unordered values
Spring 4.3.4 with weblogic 12.1 Causing org.xml.sax.SAXParseException;Attribute “singleton” must be declared for element type “bean”
Hibernate fails to delete an item from a list of entities
Print message in the repository randomly
question mark characters and page refresh
Java Connectivity
how to make a time format in -01:-05:00 to -01:05:00
MySQL autoincrement jumps on the closest 51
MSWord to Images using JODConverter
Kerboros cached ticket deleted after using Windows lock screen
How to solve StringConverter ClassCast Exception?
JAXB binding for xs:integer to Java Integer instead of BigInteger
Error:Process 'command '/usr/local/android-studio/jre/bin/java'' finished with non-zero exit value 2
Java - enum with static counter

Categories

HOME
variables
mediawiki
programming-languages
rubygems
constraint-programming
multiple-records
dacpac
maude-system
user-input
messages
iron-router
lombok
highlight.js
excel-vba-mac
visual-composer
dbext
predix
google-search-api
pass-by-reference
dxf
java-7
underflow
windows-error-reporting
nouislider
sql-server-2012-express
react-chartjs
binary-data
bosh
titanium-mobile
stringtemplate
language-concepts
mmenu
http-digest
withings
abstract-class
ssjs
android-fingerprint-api
mesos-chronos
acoustics
btrace
galleria
scorm
angular-resource
celery-task
mu
tropo
font-size
medium.com
jquery-filter
url-masking
asp.net-4.5
lua-5.1
testng-dataprovider
php-parse-error
xpath-1.0
pervasive-sql
tmuxinator
varargs
inmobi
modalpopup
offloading
pick
xc16
gadt
knuth
google-style-guide
client-side-templating
xcode-6.2
jquery-layout
wp-query
android-2.2-froyo
floating-point-precision
commoncrypto
tidy
cos
ember-app-kit
pygit2
robotics-studio
gil
ocx
code-cleanup
gnustep
propagation
google-friend-connect
sef
microsoft-virtualization
spec#

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App