Monday, 14 December 2015

what is public? what is static? what is void? what is main? what is string args[]? what is system.out.println()? in java

                                                           Hiiiiii... am back to tell what is?

ok see the code once again (not the C O D E ):

C O D E:
          package com;
          public class HelloJavaClassName

          {
          public static void main(String []args)

          {
          System.out.println("Hello World");
          }
          }


what is public?

public class HelloJavaClassName

we called this (Public, Private, Protectedaccess modifiers ...and also this is a keyword so we can not use this as variable. I hope you know what is  variables if you are not I do not care ha ha ha...

Public is like Public, a variable or method is public means that can access by any class

Ex:--
                  public int a;

 this is a public variable this variable can access from anywhere form your entire application so we called this as global variable

oK dude! what is 

public class HelloJavaClassName
{

}

This is called class , it can be defined as template it describes the object behaviours
 

ok then what is object ?


Object is an instance of a class it  has its own states and behaviours.

ok yaaarrr now I can understand what is class but inside the class something is there what is that?

public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}

}

This is what we called method,  a class can contain many method  u can c d keyword  main so this is main method. It is always public because it has to be accessed by the runtime.

yaa u can create your own method inside the class ... but listen you method name should start with smaller case (naming conversion).

for example:

public class HelloJavaClassName
{
public void shouldStartWithSmallCase()
}

this is called method name shouldStartWithSmallCase()

What is static?


Static is also keyword, if You use static keyword to the variable that variable value is static to the entire application.

public class HelloJavaClassName
{
static int pi=3.14159265358979323846264338327950288419716939937510582097494459230781640
}

The pi value is, Oh! sorry you can use 3.14 this value never going to change so we can declare this pi variable as static, for your entire program the pi value is 3.14 only this is we called static variable

static variable gets memory once at the time of class loading...


oKeY! why we use public static void main(String []args) ?

This is the main function, any doubt on that if any read from first. Main function should run first , the static keyword trigger the main function for first execution. so every program started to run from main class. That means main class always run first.

what is void ?

This method just print helloworld so we are not going to return any value here, void means that the method has no return value.

what is string args[]?

string and args is keyword ,java takes every values as string so we use the data type string.args[] is argument array of console line values stored in the [] array argument.
I know it is little bit difficult to understand study about array and data type then u can understand little bit more...

what is system.out.println()?

what is class? what is package(check on previous post)? what is method?
 
If you know the answer for the previous questions then you can understand system.out.println
 
System  is a class in the package of  java.lang
 
out  is the instance of java.io.PrintStream
 
println is the methosd of  java.io.PrintStream
 
This will help to print the output......
 
ok session is end today c u sooon...












  

31 comments:

  1. I love your blog.. very nice colors & theme. Did you create
    this website yourself or did you hire someone to do it for you?

    Plz reply as I'm looking to create my own blog and would like to find
    out where u got this from. appreciate it

    Also visit my web blog :: Doggy Dans Online Dog Trainer System

    ReplyDelete
    Replies
    1. thanks for your compliments, yes I created this one and also
      visit:http://me2yet.blogspot.in/

      Delete
  2. Fantastic post however , I was wondering iff you
    could write a littee more oon thhis topic?
    I'd be vefy grateful if you could elaborate a little bit further.
    Thank you!

    My web page ... Buy computers Used

    ReplyDelete
  3. Link exchange is nothing else but it is simply placing the other person's weblog link on your
    page at suitable place andd other person wikl also
    do sane in support of you.

    Here is my homepage ... natural treatment tinnitus at home -
    -

    ReplyDelete
  4. I’m not that much of a online reader to be honest but your sites reaoly nice, keep it up!
    I'll go ahead and bookmark your site to come back in the future.
    Cheers

    Have a loook at my site: sleep apnea cure weight loss

    ReplyDelete
  5. It's in fact very difficult in this busy life to listen news on TV,
    thus I only use web for that purpose, and obtain the most recent information.

    Review my site: fashion club animazione

    ReplyDelete
  6. you are in reality a excellent webmaster. The web
    site loading pace is amazing. It seems that you
    are doing any distinctive trick. In addition, The contents are masterpiece.
    you have done a wonderful task in this subject!

    my web blog; how to fix negative reviews online

    ReplyDelete
  7. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of The Salvation Diet Free Download - ,
    costs. But he's tryiong none the less. I've been using WordPress on numerous websites for about a
    year and am concerned about switching to another platform.
    I have heard fantastic things about blogengine.net. Is there a way I can import all my wordpress posts into it?
    Any kind of help would be greatly appreciated!

    ReplyDelete
  8. This design is spectacular! You most certainly know how to
    keep a reader entertained. Between your wit and your videos, I was almost
    moved to start my own blog (well, almost...HaHa!) Great job.
    I really enjoyed what you had to say, and more than that, how you
    presented it. Too cool!

    Visit my web-site: clash of clans hack

    ReplyDelete
  9. I believe everything said was actually very reasonable. However, what about this?
    suppose you were to write a awesome post title?
    I mean, I don't want to tell you how to run your website, however what if you added a title
    to maybe get people's attention? I mean "what is public? what is static? what is void? what is main? what is string args[]? what is system.out.println()? in java" is a little
    vanilla. You might peek at Yahoo's front page and see how they create article headlines to grab viewers to open the links.
    You might try adding a video or a pic or two to grab readers excited about what you've got to say.
    In my opinion, it might bring your posts a little livelier.


    Review my site -

    ReplyDelete
    Replies
    1. Thanks for your advice ill give my best...

      Delete
  10. Hey very nice blog!

    Check out my web blog what Men secretly Want pdf review

    ReplyDelete
  11. A person essentially assist to make critically posts I might state.
    That is the first time I frequented your website page and thus far?
    I surprised with the research you made to make this particular put up amazing.
    Magnificent process!

    Also visit my web page :: Carly Brooke Avraham

    ReplyDelete
  12. I am really enjoying the theme/design of your weblog.
    Do you ever run into any web browser compatibility problems?

    A handful of my blog audience have complained about my blog not working
    correctly in Explorer but looks great in Firefox. Do you have any recommendations
    to help fix this issue?

    Feel free to visit my blog :: PaleoHacks Cookbook Review

    ReplyDelete
  13. Hi, I believe your web site could be having internet
    browser compatibility problems. When I look at your website in Safari, it looks fine however,
    if opening in IE, it's got some overlapping issues.

    I simply wanted to provide you with a quick heads up!
    Besides that, fantastic blog!

    Have a look at my page 3 Week Diet Review

    ReplyDelete
  14. You've made some decent points there. I looked on the web
    for more info about the issue and found most people will go
    along with your views on this web site.

    my web blog :: Thought Elevators Scam

    ReplyDelete
  15. Wonderful post! We are linking to this particularly great article
    on our website. Keep up the great writing.

    Also visit my page: BoomBeachGenerator.gq

    ReplyDelete
  16. First off I would like to say superb blog! I had a quick question that I'd like to ask if you don't mind.
    I was curious to know how you center yourself and clear your thoughts before writing.

    I've had a hard time clearing my mind in getting my thoughts out.
    I do take pleasure in writing however it just seems like the first 10 to 15 minutes are lost simply just trying to figure out how to begin. Any recommendations or hints?
    Thank you!

    Look at my homepage ... Jason Long's ED Protocol

    ReplyDelete
  17. Hmm PaleoHacks Cookbook – Is It The Best Paleo Cookbook looks like your
    blog ate my first comment (it was super long) so I guess I'll
    just sum it up what I wrote and say, I'm thoroughly enjoying your blog.

    I as well am an aspiring blog writer but I'm still
    new to the whole thing. Do you have any tips and hints for newbie blog writers?
    I'd definitely appreciate it.

    ReplyDelete
  18. Do you mind if I quote a few of your posts as long
    as I provide credit and sources back to your site?
    My blog is in the very same Doggy Dans Online Dog Trainer members area reviews of interest as yours and my visitors would definitely benefit from some of the
    information you present here. Please let me know if this alright
    with you. Many thanks!

    ReplyDelete
  19. Hello, for all time i used to check blog posts here in the early hours in the morning,
    for the reason that i like to gain knowledge of more and more.


    Here is my site - 50 Shades of grey pdf

    ReplyDelete
  20. Quality articles is the main to attract the users to pay a visit the web site, that's what
    this website is providing.

    Also visit my website - 3 week diet by Brian Flatt

    ReplyDelete
  21. Greetings I am so thrilled I found your blog page, I really found you by error, while I was searching on Yahoo for something else,
    Anyways I am here now and would just like to say thank you for a tremendous post and a all round interesting blog (I also love the theme/design),
    I don’t have time to go through it all at the moment but I have saved it
    and also added your RSS feeds, so when I have time I will be back to read a great deal more,
    Please do keep up The E-factor Diet Review superb jo.

    ReplyDelete
  22. If you are going for best contents like me, simply
    visit this website every day as it presents feature
    contents, thanks

    Visit my page ... steam wallet code generator (http://advanceflight.com/profile/lizzieboyes)

    ReplyDelete
  23. What's up to every single one, it's actually a pleasant for
    me to visit this site, it consists of valuable Information.

    Check out my web site Thought Elevators Review

    ReplyDelete
  24. Hi there, I discovered your web site by the use of Google at the same time as looking for a comparable subject,
    your site got here up, it looks good. I have bookmarked it in my google bookmarks.

    Hi there, simply was aware of your weblog via Google, and located that it's really informative.
    I am gonna be careful for brussels. I will appreciate if you continue this in future.
    Many other people will be benefited out of your writing.
    Cheers!

    Feel free to visit my blog post fat diminisher review

    ReplyDelete
  25. Currently it appears like Movable Type is Survive The End Days PDF best blogging platform available right
    now. (from what I've read) Is that what you're using on your blog?

    ReplyDelete