In Java we can not override a method which is static, but we can implement the method with the same name and parameters. This is called shadowing and not overriding.
what is the use of constructor inside abstract class
Instance of Abstract class cant be created but still there are few things that needs to be taken care:
In java, we have two compiler like HotSpot Client and Hotspot server compiler. Why we need two different types of compilers?
The "-client" mode will use the JIT compiler originally developed by Apple -- and it does a straight to native upon the class load. It is great for relatively short lived programs.
Why We declares main method always public ?
Because the rules of the JVM say that when it launches your program, it will look for a public main method in the class you give it.
Try To Predict Output--2
Test Your Java Fundamentals By Predict Its Output.......
Comment If you Like It........
class Scratch {
public static void main( String[] args) {
Parent p1 = new Parent();
Parent p2 = new Parent();
Child c1 = new Child();
Child c2 = new Child();
Try To Predict Output--1
Guys Test Your Java Fundamentals By Try To Predict Its Output.
class You{
static int i;
static void method(){
System.out.println("Method in You "+i);}}
Comment Here If You Like It.....
static int i;
static void method(){
System.out.println("Method in You "+i);}}
More Than One Main Method...Possible ??
Yes, Of-course It Is Possible......
Have a Look At This Piece Of Code......
Please Comment If You Like It.......
****************************** ****************************** ******CODE
START************************* ****************************** **************
//Compile the Program.
//Execute Class C.
Have a Look At This Piece Of Code......
Please Comment If You Like It.......
******************************
START*************************
//Compile the Program.
//Execute Class C.
Subscribe to:
Comments (Atom)