• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Simple Help

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have two questions and i know someone will help me to figer out the correct answers.
Q#1
can we override a native method? or can we override a method to a native method?
Q#2
Does Hastmap implement map interface and can grow automatically?

Your help would be appreciated !
vivek

[This message has been edited by Vivek Shrivastava (edited July 20, 2000).]
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vivek,
Hope this answers ur question # 1.
This is from the Sun Documentation.
Native - The native keyword signals to the Java compiler that the function is a native language function. Means the method is written in another programming language because the native keyword appears as part of its method
Secondly, the native method declaration is terminated with a semicolon (the statement terminator symbol) because the Java class file does not include implementations for native methods.
Aruna
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any help on Question no. 2.
I just tried to override a method with native method or override a native method to simple method. it worked out.
looking forward to hear from u guys.
vivek
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vivek,
1)Yes you can override a native method to be non-native and vice-versa. You can do the same thing for synchronized keyword. These are not part of the method's signature, hence you can add/drop them when overriding.
2)Yes HashMap implements Map interface and it can grow automatically. HashMap is exactly similar to Hashtable, with the exceptions that unlike Hashtable, it is unsyncronized and it permits null keys and null values.
Hope this helps!

Originally posted by Vivek Shrivastava:
Hi,
I have two questions and i know someone will help me to figer out the correct answers.
Q#1
can we override a native method? or can we override a method to a native method?
Q#2
Does Hastmap implement map interface and can grow automatically?

Your help would be appreciated !
vivek
[This message has been edited by Vivek Shrivastava (edited July 20, 2000).]


 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanku very much Bhatra.
regards
vivek
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic