AbstractMethodError:
AbstractMethodError:
This java.lang.AbstractMethodError is usually thrown when we try to invoke the abstract method.
we know that an abstract method cannot be invoked and if we try to do so then you will get a compile-time error.So you may think how this error is thrown at run-time?.
The reason is binary incompatibility-what does it mean?
Whenever a class is modified,other classes that refer to this (modified) class will not be aware of the changes made in it.So all the classes must be compiled as a whole.If not then you may encounter one of the subclasses of incompatible class change error.
"This error indicates that the method that you invoke is converted into an abstract method now".
see the following example to have an idea about this error
class B
{
public void display()
{
System.out.println("I am inside B");
}
}
import java.util.*;
public class A extends B
{
public static void main(String args[])
{
A a=new A();
a.display();
}
}
output:
C:\blog>javac A.java
C:\blog>java A
I am inside B
Now i am going to convert the display() method as an abstract method and compile it alone.
abstract class B
{
public abstract void display();
}
Output:
C:\blog>javac A.java
C:\blog>java A
I am inside B
C:\blog>javac B.java
C:\blog>java A
Exception in thread "main" java.lang.AbstractMethodError: B.display()V
at A.display(A.java:3)
at A.main(A.java:8)
AbstractMethodError:的更多相关文章
- 疑惑的 java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L
在MAVEN项目里面,在整合spring和mybatis在执行数据库操作的时候报出了: java.lang.AbstractMethodError: org.mybatis.spring.transa ...
- 使用DBCP时发生AbstractMethodError异常
使用DBCP时发生AbstractMethodError异常,错误描述: Exception in thread "main" java.lang.AbstractMethodEr ...
- 疑难杂症:java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/String;)V
错误: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/Strin ...
- HIbernate java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z
[HIbernate]java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGe ...
- AbstractMethodError using UriBuilder on JAX-RS
问题描述:Eclipse调试JAX-RS服务没问题,但是在发布服务端时候抛出异常 java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder. ...
- java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer; at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.jav
在整合spring和mybatis在执行数据库操作的时候报出了: java.lang.AbstractMethodError: org.mybatis.spring.transaction.Sprin ...
- Spark踩坑——java.lang.AbstractMethodError
今天新开发的Structured streaming部署到集群时,总是报这个错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: ...
- QA:Initialization of bean failed; nested exception is java.lang.AbstractMethodError
Q: <hibernate.version>5.2.10.Final</hibernate.version><dependency> <groupId> ...
- java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L
mybatis与springboot集成的时候,报错:java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManag ...
随机推荐
- js之promise讲解
1 Promise概述 Promise对象是CommonJS工作组提出的一种规范,目的是为异步操作提供统一接口. 那么,什么是Promises? 首先,它是一个对象,也就是说与其他JavaScript ...
- 那些年我们跳过的 IE坑
一, IE input X 去掉文本框的叉叉和密码输入框的眼睛图标 解: 从IE 10开始,type=”text” 的 input 在用户输入内容后,会自动产生一个小叉叉(X),方便用户点击清 ...
- [LeetCode] Flatten a Multilevel Doubly Linked List 压平一个多层的双向链表
You are given a doubly linked list which in addition to the next and previous pointers, it could hav ...
- 太原面经分享:如何用js实现返回斐波那契数列的第n个值的函数
面试攒经验,let's go! 值此高考来临之际,闲不住的我又双叒叕出发去面试攒经验了,去了公司交待一番流程后,面试官甩给了我一张A4纸,上面写着一道js算法笔试题(一开始我并不知道这是在考察js算法 ...
- node 学习(二)
写基础太麻烦了 我花了个基础知识的脑图
- 问题:CGI返回给前端的汉字数据是乱码(已解决)
今天,我在写CGI程序,把后台数据返回到前台页面上,出现乱码, 不好看,所以,我在Content-type:application后面加了字符集的设置(字符集和前端一样), fprintf(stdou ...
- nginx r日志中午出现\xE5\x88\x98\xE4\xB8\x96\xE5\xA5\x87
参考文档: https://www.cnblogs.com/hark0623/p/5715726.html https://www.cnblogs.com/fqfanqi/p/7900758.html ...
- c++第五周学习小结
上周快乐的国庆假期有令我不太快乐的C++作业,我还是坚强的把它完成了.做C++就是在快乐和不快乐徘徊的过程.当你慢慢摸索写出正确答案时获得的成就感还是很开心的,但是当你苦苦思考还是无法完成时简直是狂躁 ...
- Facebook AI的工业级NLP开源框架—— Pytext
PyText是基于NLP深度学习技术.通过Pytorch构建的建模框架.PyText解决了既要实现快速实验又要部署大规模服务模型的经常相互冲突.并且,Facebook已经采用了使用PyText快速迭代 ...
- WinForm控件Dock属性设置会遮盖其他控件的解决
在被遮盖住的控件上,右击弹出快捷菜单,然后选择“置于顶层”.