• 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

Question assertion as keyword and indentifier

 
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone illustrate the assertion used as indertifier and as keyword with example. I could see many questions in exam.
Please, it would be greatful to me.
 
Ranch Hand
Posts: 274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the K&B book for detailed information, as required for the exam.

I believe you just jumped to mocks/simulator, before preparing and learning Java
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
class Elm
{
public static void main(String [] args)
{
int assert=0;
}
}


When you compile this program you get this erro ====>
D:\javapgms>javac Elm.java
Elm.java:10: as of release 1.4, 'assert' is a keyword, and may not be used as an
identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
int assert=0;
^
1 error
 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have read k&b, but not able to get, that is why i posted here, so that people on this can help me to understand this concept.
 
Gitesh Ramchandani
Ranch Hand
Posts: 274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dinesh Tahiliani:
i have read k&b, but not able to get, that is why i posted here, so that people on this can help me to understand this concept.



OK...here are a few links:

[URL=http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
http://www.sap-img.com/java/assertion-in-java.htm]http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
http://www.sap-img.com/java/assertion-in-java.htm[/url]
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic