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

Case Analysis of Java Grammar

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "Java Grammar case Analysis". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "Java Grammar case Analysis".

First, public class TestDemo220427 {public static void main (String [] args) {/ / to find primes between 1m and 100 as an example: for (int I = 2bot I is changed to num = num > 1, move to the right unsigned, so that the high position will only make up 0, which is suitable for both positive and negative numbers.

Expansion: some people may ask, since you can move to the right, why not move to the left?

The answer is: it is possible to move to the left, but it is not recommended, and the efficiency is too low.

Public class TestDemo220427 {public static int getOnecount (int num) {int count = 0; for (int I = 0 (I = 0) < 32 (if) {if ((num & (1))

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

Development

Wechat

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

12
Report