---
title: "java得到当前方法的名字"
author: "不朽之城"
date: "2015-03-17T14:57:50Z"
tags: []
categories: ["编程语言"]
slug: "java"
draft: false
lastmod: "2015-03-17T14:57:50Z"
id: 2193145
url: "https://wujq4java.iteye.com/blog/2193145"
---

**得到当前方法的名字**

 

```
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
```