Skip to main content

Featured

Game Development Tutorials In Android

Game Development Tutorials In Android Hi Guys,                 We are shortly started Game Development Tutorials in Android Studio. So everyone supports me and share this blogs to your friends. Guys, At this time everyone is freely available to source code and we are provide a video for step by step game developments. you are learn free and feel free to support us. Guys, if you have any question to me, so feel free to comment us. I will try to answer all the question as long as possible.                                                     Thank's                                                                          ...

Constructor example in java

Learn Java Programming Language Part - II

This is very simple example for constructor in java. 

constructor in Java is a block of code similar to a method that's called when an instance of an object is created. Here are the key differences between a constructor and a method: A constructor doesn't have a return type. The name of the constructor must be the same as the name of the class.


public class MyConstructor
{
    public MyConstructor()
    {
          System.out.println("Feel Easy for Java Programming");
    }
    public static void main(String args[])
    {
         new MyConstructor();
    }
}

save this file : MyConstructor.java

compile this file : javac MyConstructor.java

Run this file : java MyConstructor

If you want to donate money if this information is useful to 
you :
If this information is important to you , and you want to , I will continue writing some more details of programming language, so click on the advertising, available on this page. This is motivate me for writing some more blogs.

Comments