JAVA實(shí)現(xiàn)打印ascii碼表代碼
我就廢話不多說了,大家還是直接看代碼吧~
package com.jalor;public class AAAA { public static void main(String[] args) { outputA(65); outputA(97); } // 打印ascii碼表 public static void outputA(int count){ for (int i = 0; i < 26; i++) { System.out.print((char)(count+ i)); } System.out.println(); }}
補(bǔ)充知識(shí):java 顯示ASCII碼字符表打印從!到~的字符,每行十個(gè)字符
public class ASCIITable {public static void main(String[] args) {{ int i=0; int count=0; for(i=33;i<=126;i++) { System.out.printf('%3c',i); count++; if(count%10==0)//這里改為10就是每行打印10個(gè)。 System.out.println('n'); } System.out.println('n');}}}
運(yùn)行結(jié)果:
! ' # $ % & ’ ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
以上這篇JAVA實(shí)現(xiàn)打印ascii碼表代碼就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. 利用CSS制作3D動(dòng)畫2. 讓chatgpt將html中的圖片轉(zhuǎn)為base64方法示例3. asp畫中畫廣告插入在每篇文章中的實(shí)現(xiàn)方法4. 熊海CMS代碼審計(jì)漏洞分析5. CSS Hack大全-教你如何區(qū)分出IE6-IE10、FireFox、Chrome、Opera6. ASP編碼必備的8條原則7. WMLScript腳本程序設(shè)計(jì)第1/9頁(yè)8. 使用純HTML的通用數(shù)據(jù)管理和服務(wù)9. asp中Request.ServerVariables的參數(shù)集合10. PHP session反序列化漏洞深入探究
