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

Write a program that reads your first name and displays your name with stars separating each letter
How to produce a map from a stream of the entries?
How can I make ant use a different javac than the one in JAVA_HOME? [duplicate]
want to delete star and the char in front and follow it, why my code does not work
How do I get normal JavaFX text field after changing text field color?
Updating server object with deserialized object through RMI
SimpleDate format returns false date for Date which is greater than 28th December [duplicate]
Having trouble seeing an IndexOutOfBoundsException
Best Java approach for comparing two text files
should nested class be declared as static if only used in wrapper clas [duplicate]
require 'java' fails in irb
how to print subsets of an array with a specific length in java
Scanner example loop
How to use Text to speech code with Text view only
Is there a way to get JButtons on a new line, JOptionPane
Android Java Library both ways compatible

Categories

HOME
webpack
reflection
kde
layout
mean-stack
routes
at-command
react-redux
sharepoint-designer
cross-browser
blueprintjs
fingerprint
wamp
swagger-ui
upload
multiple-records
applepay
slurm
dacpac
volttron
offline
google-cloud-spanner
phaser
opentracing
graphlab
flux
openedx
predix
h2db
semantic-analysis
tasklet
unboundid
flink-streaming
nat
directx-10
kendo-ui-grid
stringtemplate
gammu
google-api-nodejs-client
file-format
xenforo
greenrobot-eventbus
user-controls
quadratic-programming
http-live-streaming
heightmap
import-from-excel
node-sass
wso2carbon
dotcover
scrollable
rdfs
mplayer
colorama
lift-json
webdriverjs
eventkit
jquery-filter
ableton-live
google-feed-api
heidisql
passport-google-oauth
url-masking
fuzzy-search
pagedlist
ready-api
captivenetwork
tform
system.management
kendonumerictextbox
intel-fortran
kcachegrind
dukescript
embedded-code
ami
key-management
kineticjs
tween
qpainter
java.util.concurrent
xcode-6.2
project-planning
fluentautomation
wp-query
balanced-payments
cloud-connect
mysqltuner
aqtime
jmapviewer
web2py-modules
blending
seed
simba
browser-detection
quickdialog
runas
asyncfileupload
punbb
php-parser
xfbml
.nettiers
castle-monorail
firefox-5
yagni
private-members
uiq3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App