• 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

strictfp

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
strictfp can be applied as a modifier to a class or interface or method. Its not inherited.

Suppose there is a non strictfp class A and it has a strictfp method method(). If there is a class B that extends A but does not override the method- method().

1- In the inherirted method would the method- method() be strictfp or not?

2- Also if some other method- method1() in the extending class B used the method- method() would method() be executed in a strict fashion?
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Swamy,

From the results of the following code:



resulting in:

public static void D.main(java.lang.String[])
public strictfp int D.method2()
public strictfp int C.method1()public native int java.lang.Object.hashCode()
public final native java.lang.Class java.lang.Object.getClass()
public final void java.lang.Object.wait() throws java.lang.InterruptedException
public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
public boolean java.lang.Object.equals(java.lang.Object)
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()
public java.lang.String java.lang.Object.toString()

it seems like the strictfp modifier is inherited as is.
I'm not familiar enough with the reflexion classes though
to entirely exclude the possibility that strictfp is not
inherited given the above results.

Maybe someone else might pop in with an answer.

Cheers,

Gian Franco Casula
[ May 19, 2004: Message edited by: Gian Franco Casula ]
 
Swamy Nathan
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope it is out of syllabus
 
Swamy Nathan
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was smart of u to use Reflection.
Wonder if anyone will step up and point to a affirmative answer.
(Dont want to wade through a lengthy document also)
reply
    Bookmark Topic Watch Topic
  • New Topic