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 ...
随机推荐
- jmeter基本组成原件介绍
jmeter基本组成原件介绍 参考地址:https://wenku.baidu.com/view/d4986ca2aaea998fcc220ec1.html 从性能工具的原理划分: Jmeter工具和 ...
- 26 Arcpy跳坑系列——ExportToPNG
最近在学习Arcpy的时候,还真是遇到了一个磨人的小妖精,我本来是想得到一个透明背景的png图的,根据官方的帮助文档, https://desktop.arcgis.com/zh-cn/arcmap/ ...
- javascript的数组之pop()
pop()方法从数组中删除最后一个元素,并返回该元素的值.此方法更改数组的长度. let a = [1, 2, 3]; a.length; a.pop(); console.log(a); // [1 ...
- SQL 序列-DML-DML-数据类型-用户管理、权限-事务-视图
--DML--insert关键字--作用:往表中插入一条(多条)记录 --元祖(tuple)值式的插入(一次插入一条记录)--语法1:insert into tablename(column1,col ...
- SAP中的一些简称及简要介绍
SAP-(System Applications and Products) 基础部分: R/3系统内核.数据库.支持各类平台的接口.ABAP(Advanced Business Applicatio ...
- HTML5 页面编辑API之Range对象
在 HTML5 中,一个 Range 对象代表页面上的一段连续区域.通过 Range 对象,可以获取或修改页面上的任何区域.包含获取,修改,删除和替换等操作. 一:获取range对象的值 Range对 ...
- 添加一个Button按钮
#增加一个Button 1. 在layout下的xml中添加 <Button android:id="@+id/button1" android:layout_width=& ...
- LeetCode 653 Two Sum IV - Input is a BST 解题报告
题目要求 Given a Binary Search Tree and a target number, return true if there exist two elements in the ...
- 微信网页授权 通过code获取openid 报错40163 code been used
使用好好的微信功能,突然安卓无法正常使用了,苹果的正常. 安卓报错内容: 40163,code been used. 题外话:微信的东西,为何报英文错误呢,装什么13. 实测结果:安卓获取用户信息时 ...
- nginx中的超时设置,请求超时、响应等待超时等
nginx比较强大,可以针对单个域名请求做出单个连接超时的配置. 比如些动态解释和静态解释可以根据业务的需求配置 proxy_connect_timeout :后端服务器连接的超时时间_发起握手等候响 ...