• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

throw new PersistenceException(""); gives compilation error

 
Ranch Hand
Posts: 114
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand why I am getting this compilation error.

Code :
throw new PersistenceException("");

gives compilation error :
'Cannot instantiate the type Persistence'
 
Rancher
Posts: 1776
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The information is not very clear. You did not show what package the PersitenceException class belongs. On a search I found it might be PersistenceException which can be very well instantiated.

Note that according to the error you are either trying to instantiate an interface or an abstract class.

Do you have an interface / abstract class named 'Persistence' ? The error rather says Persistence and not PersistenceException
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!