Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the methods of Java addition operation

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the methods of Java addition". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the methods of Java addition"?

1.int addition 1.1 simple demopublic class add {public static void main (String [] args) {int aquidus 10; int bau11; bounafib; System.out.println (b);} 1.2 compiles and runs the output.

1.3The exploration of class files. 1.3.1 this is the constant pool described in the last two sections.

1.3.2 access flag (access_flags)

(1) ACC_ENUM marker bit

First of all, let's take a look at this. If an enumeration class is defined, then the JVM virtual machine will put the second bit of access_flags as 1.

(2) ACC_ANNOTATION marker bit

Look at the meaning of the word ANNOTAION comment, here is if there is an annotation class, KVM will put the third position of access_flags as 1

(3) ACC_SYNTHETIC marker bit

If it is not compiled by the JVM compiler, if it is the user's own, the fourth position will be 1.

(4) ACC_ABSTARACT marker bit

When defining a class, JVM places the ACC_ABSTARACT flag at 1.

(5) ACC_INTERFACE marker bit

When defining an interface, JVM places the ACC_INTERFACE flag at 1.

(6) ACC_SUPER marker bit

For a defined class, JVM places the ACC_SUPER flag at 1.

(7) ACC_FINAL marker bit

If the class is declared with a final type, if so, the ACC_FINAL flag is positioned at 1.

(8) ACC_PUBLIC marker bit

If the class is declared with a public type, JVM places the ACC_PUBLIC flag at 1.

1.3.3 Exploration of this document

1.4 A simpler way to view.

Javap-v name

Just check it out.

1.5 smali file analysis

I won't go into detail here on how to convert class files into smali files. For details, please refer to

Android inverse-java Code Base (1)

1.5.1 this is the overall picture of the smali code.

1.5.2 A must-have

1.5.3 main function

2 float addition 2.1 demopublic class add {public static void main (String [] args) {float axiom 1.1f; System.out.println (aura);}} 2.2 class file analysis

2.3 smali file analysis 2.3.1 essential

2.3.2main

Add-float/2addr vx,vy # Adds vy to vx.

That is to say, add the values of vx and vy.

We have seen other grammars before, and have explained them in great detail in Android inverse-java Code Foundation (2), so I won't repeat them here.

3 try to write a piece of code using smali. 3.1demo.class public Ladd;.super Ljava/lang/Object;.source "add.java" .method public constructor () V .registers 1 .prologue .line 1 invoke-direct {p0}, Ljava/lang/Object;- > () V return-void.end method.method public static main ([prologue) V .registers 3 .prologue # start const v0Magol 0x3f8ccccd const v1mt 0x4f8ccccd sget-object v2 Langa Lancet-> out:Ljava/io/PrintStream Add-float/2addr v0J v1 invoke-virtual {v2je v0}, Ljava/io/PrintStream;- > println (F) V return-void.end method3.2jar compilation

Thank you for your reading, the above is the content of "what are the Java addition methods?" after the study of this article, I believe you have a deeper understanding of what the Java addition operation method has, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report