java简单编写python的print

java简单编写python的print,第1张

java简单编写python的print
public class print
{
   public print()
   {
      System.out.println("python print operating...");
   }
   public print(int a)
   {
      System.out.println(a);
   }
   public print(double a)
   {
      System.out.println(a);
   }
   public print(boolean a)
   {
      System.out.println(a);
   }
   public print(String a)
   {
      System.out.println(a);
   }
   public print(int[] a)
   {
      for(int i : a)
      {
         System.out.print(i);
         System.out.print(i == a[a.length-1]?"":",");
      }
   }
   public print(int[] a, String b)
   {
      for(int i : a)
      {
         System.out.print(i);
         if(b == "sep=\")
         {
            System.out.print(i == a[a.length-1]?"":"\");
         }
         if(b == "sep=.")
         {
            System.out.print(i == a[a.length-1]?"":".");
         }
         if(b == "sep=-")
         {
            System.out.print(i == a[a.length-1]?"":"-");
         }
         if(b == "sep=_")
         {
            System.out.print(i == a[a.length-1]?"":"_");
         }
         if(b == "sep=/")
         {
            System.out.print(i == a[a.length-1]?"":"/");
         }
      }
   }
}

就是玩玩,没什么技术含量,大家想用就用。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5716733.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存