• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Native,Synchronized,Find!!!!

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am very new to Java world.
Please let me know what is constructors, default constructors, Static,Find,Native and Synchronized?
If it is possible by simple example,
Thanks a lot in advance
ADS
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In general, the Java Language Specification covers these topics pretty well. Here is some info to get you started though.
Constructor. A special method of a class that is executed when a new instance of the class is to be created. e.g. Circle c = new Circle(x,y,radius); calls the Circle constructor with the matching signature (i.e. method name, arguments and argument types, and return type). Constructors have no return type by the way, not void, simply no return type.
Default Constructor. A constructor method which takes no arguments.
Static. A Java modifier, which when applied, results in the variable or method being a class variable or class method. A class variable has the same value in all instances of the class. An instance variable is dependent upon the instance in which it resides.
Final. (I think this is what you meant.) A Java modifier which indicates that a variable cannot be changed, a method cannot be overridden, or a class cannot be subclassed. Final variables can be instance or class variables, or as method parameters.
Native. A Java modifier which indicates that the implementation of the method is done externally to Java. Typically used to access a third party implementation of a C or C++ library.
Synchronized. A Java modifier, and expression, which notes a point of serialization. e.g. A method which has been marked as synchronized indicates that only one instance of the method may be run by a given thread at a time. When used as an expression (e.g. synchronized(this)), indicates that the block of code is a point of serialization.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Doug ,
Thanks a bunch!
Please give me more clarification about Native and Synchronize

Thanks in advance
ADS

Originally posted by ADS:
Hi,
I am very new to Java world.
Please let me know what is constructors, default constructors, Static,Find,Native and Synchronized?
If it is possible by simple example,
Thanks a lot in advance
ADS


 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clarification:
Default constructor: A constructor method which takes no arguments which is supplied by java if and ONLY IF there is no explicit constructor. If you want a constructor with no arguments AND a constructor with arguments, you must write both constructors.
Marilyn
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marilyn,
Thanks a lot!
ADS

Originally posted by ADS:
Hi,
I am very new to Java world.
Please let me know what is constructors, default constructors, Static,Find,Native and Synchronized?
If it is possible by simple example,
Thanks a lot in advance
ADS


 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic