为了整洁而删除的代码

2024-03-12 02:08
文章标签 代码 删除 整洁

本文主要是介绍为了整洁而删除的代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Eclipse里面  的代码  为了整洁  删除以前全部 重写了 一遍

按照顺序排列好   以防不时之需  以及效率 。没有关系 加油

 

public class DataDemo06 {

    public static void main(String[] args){

          float num = 3.0f;

          System.out.println("两个小数相乘=" + num * num);

}

}

 

 

public class DataDemo10 {

public static void main(String[] args){

int i=1;

int j=2;

System.out.println("i+j="+(i+j));

}

 

}

 

 

package list;

 

import java.awt.List;

 

public class list {

List l1=new LinkedList();

List l2=new LinkedList();

for(int i=0;i<=9;i++){l1.add("a"+i);

}

 

 

 

 

}

 

 

 

 

 

public class DataMemo09 {

public static void main(String[] args){

String str = "lixinghua";

int x = 30;

str = str + x ;

System.out.println("str="+str);

}

 

}

 

 

public class operatordemo03 {

public static void main(String[] args){

int x =10;

int y =3;

 System.out.println(x+"+"+y+"="+(x+y));

 System.out.println(x+"-"+y+"="+(x-y));

 

 System.out.println(x+"*"+y+"="+(x*y));

 System.out.println(x+"/"+y+"="+(x/y));

 System.out.println(x+"%"+y+"="+(x%y));

 

 

}

 

}

 

 

 

public class operatordemo04 {

public static void main(String[] args){

System.out.println("3>1="+(3>10));

System.out.println("3<=1="+(3<=1));

System.out.println("3==1="+(3==1));

System.out.println("3!=1="+(3!=1));

}

 

}

 

 

public class operatordemo05 {

public static void main(String[] args){

if(5>2);

System.out.println("条件成立:5大于2");

if(true);

System.out.println("直接写的true");

if((3+6)==(3-6));

System.out.println("这是不成立的");

}

 

}

 

 

public class operatordemo06 {

public static void main(String[] args){

int a=3,b=3;

int x=6,y=6;

 System.out.println("a="+a);

 System.out.println("\t a++="+(a++)+",a="+a);

 System.out.println("b="+b);

 System.out.println("\t b++"+(b++)+",b="+b);

 System.out.println("x="+x);

 System.out.println("\t= x++"+(x++)+",x="+x);

 System.out.println("y="+y);

 System.out.println("\t y++"+(y++)+",y="+y);

 

}

 

}

 

 

public class operatordemo07 {

 public static void main(String[] args){

 boolean a=true;

 boolean b=false;

 System.out.println("a||b="+(a||b));

 System.out.println("a|b="+(a|b));

 System.out.println("a&&b="+(a&&b));

 System.out.println("a&b="+(a&b));

 

 }

 

}

 

 

 

public class operatordemo08 {

 public static void main(String[] args){

 int score=50;

 if((score<0)||(score>100)){

 System.out.println("输入的成绩有错误");

if((score>40)&&(score<60));

     System.out.println("准备补考吧");

 

 }

 }

 }

 

 

 

public class operatordemo09 {

 public static void main(String[] args){

 int x=10/0;

 System.out.println("x="+x);

 

 

 }

 

}

 

 

 

 

public class opertordemo01 {

public static void main(String[] args){

int num =12;

System.out.println("第一次输出="+num);

num=num-3;

System.out.println("第二次输出="+num);

}

 

}

 

package math99;

 

public class math99 {

 

 

public static void main (String[] args){

for(int i = 1;i <= 9;i ++){

for(int j = 1;j <= i;j ++){

System.out.print(i+"*"+j+"="+(i*j)+"\t");

}

System.out.print("\n");

}

}

}

 

 

 

package question;

 

public class change {

 public static void main(String[] args){

 int a=1;

 int b=2;

 int temp;

 temp=a;

 a=b;

 b=temp;

 System.out.printf("a="+"a"+"\n");

 System.out.printf("b="+"b");

 }

 }

 

 

package question;

public class manyquestions{

 public static void main(String[] args){

   int n;

   int a,b,c;

   

  

   for(n=100;n<1000;n++);{

   

   a=n%10;

   b=n/10%10;

   c=n/100%10;

 

     if(n==Math.pow(a,3)+Math.pow(b, 3)+Math.pow(c, 3));

     

      

      

      System.out.printf(n+"");

 }

 }

 }          

 

 

 

  package rongqi;

 

import java.util.Collection;

 

public class rongqi01 {

public static void main (String[] args){

Collection c=new HashSet();

c.add("hello");

c.add(new Name("f1","11"));

c.add(Integer(100));

c.remove("hello");

c.remove(new Integer(100));

System.out.ptintln

             (c.remove(new Name("f1","11")));

System.out.ptintln(c);

}

 

}

 

 

 

 

package test;

 

public class test {

static int j;

public void m(){

int i=0;

System.out.println(i);

}

public static void main(String[] args){

int i=0;

System.out.println(i);

System.out.println(j);

boolean b=false;

if(b){

 int c=0;

 System.out.println("b is true");

}

System.out.println("c");

 

}

}

 

 

 

package test;

 

public class teststringclass04 {

  public static  void main(String[] args){

  int j=1234567;

  String sNumber=String.valueOf(j);

  System.out.println

  ("j是"+sNumber.length()+"位数。");

  String s="Mary,F,1976";

  String[] sPlit=s.split(",");

  for(int i=0;i<sPlit.length;i++){

   System.out.println(sPlit[i]);

  }

  }

 

  

 

}

 

 

package test;

 

public class teststringexercise {

//输出一个程序 输出一个字符串中的大写英文字母数,小写英文字母树以及非英文字母数

//编写一个方法 输出在一个字符串中 指出字符串出现的次数

 void count(String s);

 

 

package rongqi;

 

public class Name01 {

private String firstName,lastName;

public Name01(String firstName,String lastName){

this.firstName=firstName;this.lastName=lastName;

}

public String getFirstName(){return firstName;}

public String getLastName(){return lastName;}

public  String  toString(){ return firstName+""+lastName;}

 

 

 

public  boolean equals(Object obj){

if (obj instanceof Name){

Name name=(Name) obj;

return  (firstName.equals(name.firstName))

(lastName.equals(name.lastName));

}

return super.equals(obj);

}

public int hashCode(){

   return firstName.hashCode();

}

}

 

 

 

package theCotDom;

 

public class DotCom {

private Object stringGuess;

 

 

public String checkYouself(String stringGuess) {

return null;

}

int guess=Interger.parseInt(stringGuess);

string result="miss";

for(int cell:locationsCells){

if (guess==cell){

result="hit";

numOfHits++;

break;

}

}

if(numOfHits==locationCells.length){

result="kill";

}

System.out.println(result);

return result;

 

}

 

这篇关于为了整洁而删除的代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/799821

相关文章

Java调用DeepSeek API的最佳实践及详细代码示例

《Java调用DeepSeekAPI的最佳实践及详细代码示例》:本文主要介绍如何使用Java调用DeepSeekAPI,包括获取API密钥、添加HTTP客户端依赖、创建HTTP请求、处理响应、... 目录1. 获取API密钥2. 添加HTTP客户端依赖3. 创建HTTP请求4. 处理响应5. 错误处理6.

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

Python中顺序结构和循环结构示例代码

《Python中顺序结构和循环结构示例代码》:本文主要介绍Python中的条件语句和循环语句,条件语句用于根据条件执行不同的代码块,循环语句用于重复执行一段代码,文章还详细说明了range函数的使... 目录一、条件语句(1)条件语句的定义(2)条件语句的语法(a)单分支 if(b)双分支 if-else(

docker如何删除悬空镜像

《docker如何删除悬空镜像》文章介绍了如何使用Docker命令删除悬空镜像,以提高服务器空间利用率,通过使用dockerimage命令结合filter和awk工具,可以过滤出没有Tag的镜像,并将... 目录docChina编程ker删除悬空镜像前言悬空镜像docker官方提供的方式自定义方式总结docker

MySQL数据库函数之JSON_EXTRACT示例代码

《MySQL数据库函数之JSON_EXTRACT示例代码》:本文主要介绍MySQL数据库函数之JSON_EXTRACT的相关资料,JSON_EXTRACT()函数用于从JSON文档中提取值,支持对... 目录前言基本语法路径表达式示例示例 1: 提取简单值示例 2: 提取嵌套值示例 3: 提取数组中的值注意

CSS3中使用flex和grid实现等高元素布局的示例代码

《CSS3中使用flex和grid实现等高元素布局的示例代码》:本文主要介绍了使用CSS3中的Flexbox和Grid布局实现等高元素布局的方法,通过简单的两列实现、每行放置3列以及全部代码的展示,展示了这两种布局方式的实现细节和效果,详细内容请阅读本文,希望能对你有所帮助... 过往的实现方法是使用浮动加

JAVA调用Deepseek的api完成基本对话简单代码示例

《JAVA调用Deepseek的api完成基本对话简单代码示例》:本文主要介绍JAVA调用Deepseek的api完成基本对话的相关资料,文中详细讲解了如何获取DeepSeekAPI密钥、添加H... 获取API密钥首先,从DeepSeek平台获取API密钥,用于身份验证。添加HTTP客户端依赖使用Jav

Java实现状态模式的示例代码

《Java实现状态模式的示例代码》状态模式是一种行为型设计模式,允许对象根据其内部状态改变行为,本文主要介绍了Java实现状态模式的示例代码,文中通过示例代码介绍的非常详细,需要的朋友们下面随着小编来... 目录一、简介1、定义2、状态模式的结构二、Java实现案例1、电灯开关状态案例2、番茄工作法状态案例

使用Python在Excel中插入、修改、提取和删除超链接

《使用Python在Excel中插入、修改、提取和删除超链接》超链接是Excel中的常用功能,通过点击超链接可以快速跳转到外部网站、本地文件或工作表中的特定单元格,有效提升数据访问的效率和用户体验,这... 目录引言使用工具python在Excel中插入超链接Python修改Excel中的超链接Python

nginx-rtmp-module模块实现视频点播的示例代码

《nginx-rtmp-module模块实现视频点播的示例代码》本文主要介绍了nginx-rtmp-module模块实现视频点播,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习... 目录预置条件Nginx点播基本配置点播远程文件指定多个播放位置参考预置条件配置点播服务器 192.