随笔分类 -  java

摘要:demo2 demo3 阅读全文
posted @ 2019-12-19 09:45 anobscureretreat 阅读(241) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) { int num1 = 10, num2 = 20; int num3 = 5, num4 = 7; System.out.println(num1++); System.out.println(... 阅读全文
posted @ 2019-12-19 09:44 anobscureretreat 阅读(135) 评论(0) 推荐(0) 编辑
摘要:demo2 阅读全文
posted @ 2019-12-19 09:41 anobscureretreat 阅读(340) 评论(0) 推荐(0) 编辑
摘要:demo2 阅读全文
posted @ 2019-12-19 09:37 anobscureretreat 阅读(240) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) { String str = "Hello world"; System.out.println("String is: " + str); String str2 = new String("Welcome to java"); System.out.println("The 阅读全文
posted @ 2019-12-19 09:35 anobscureretreat 阅读(3020) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) { int num; num = 5; System.out.println("the value of num is " + num); } } OUTPUT: the value of num... 阅读全文
posted @ 2019-12-19 09:33 anobscureretreat 阅读(1536) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) { // java compiler ignores the comment System.out.println("Java programmer"); /* * comments make c... 阅读全文
posted @ 2019-12-19 09:31 anobscureretreat 阅读(850) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) { System.out.print("Hello programmers!!!"); } } OUTPUT: Hello programmers!!! 阅读全文
posted @ 2019-12-19 09:27 anobscureretreat 阅读(113) 评论(0) 推荐(0) 编辑
摘要:public class Sample { public static void main(String[] args) {int a, b, c, d, e; Scanner s = new Scanner(System.in); System.out.print("Enter any integer a:"); a = s.nex... 阅读全文
posted @ 2019-12-14 09:56 anobscureretreat 阅读(563) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { int dNum = 1264; String str = ""; while (dNum > 0) { int rem = dNum % 2; str = rem + str; dNum = dNum / 2; } System.out.println("Binary 阅读全文
posted @ 2019-12-10 12:08 anobscureretreat 阅读(162) 评论(0) 推荐(0) 编辑
摘要:package testpacknm; import java.util.Scanner; public class testcnm { public static void main(String[] args) { int dNum = 5; System.out.println("Binary is: " + Integer.toBinaryString(dNum)); } } 阅读全文
posted @ 2019-12-10 12:02 anobscureretreat 阅读(85) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { Scanner ip = new Scanner(System.in); System.out.print("Enter radius: "); double radius = ip.nextDouble(); double circumference = 2 * 3. 阅读全文
posted @ 2019-12-09 19:58 anobscureretreat 阅读(138) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { Scanner ip = new Scanner(System.in); System.out.print("Enter a number: "); double n = ip.nextDouble(); ... 阅读全文
posted @ 2019-12-09 19:55 anobscureretreat 阅读(130) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { Scanner ip = new Scanner(System.in); double input = 0; int count = 0; double sum = 0; while (input != -1) { System.out.print("Enter inp 阅读全文
posted @ 2019-12-09 19:49 anobscureretreat 阅读(138) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { Scanner ip = new Scanner(System.in); System.out.print("Enter A: "); int a = ip.nextInt(); System.out.print("Enter B: "); int b = ip.nex 阅读全文
posted @ 2019-12-09 19:47 anobscureretreat 阅读(93) 评论(0) 推荐(0) 编辑
摘要:public class Solution { public static void main(String[] args) { int x = 11, y = 7; int res = 1; for (int i = 1; i <= y; i++) res = i * x; System.out.println("The product of " + x + " and " + y + " is 阅读全文
posted @ 2019-12-09 19:43 anobscureretreat 阅读(160) 评论(0) 推荐(0) 编辑
摘要:输出 阅读全文
posted @ 2019-12-09 12:30 anobscureretreat 阅读(154) 评论(0) 推荐(0) 编辑
摘要:package testjavapro; import org.junit.*; import org.junit.Test; import static org.junit.Assert.assertEquals; public class testjava { @BeforeClass public static void beforeClass() { ... 阅读全文
posted @ 2019-11-20 14:53 anobscureretreat 阅读(191) 评论(0) 推荐(0) 编辑
摘要:public class Animal { private String name; private int id; public Animal(String myName, int myid) { name = myName; id = myid; } public void eat(){ System.out.println(name+"正在吃"); } public void sleep() 阅读全文
posted @ 2019-10-19 22:52 anobscureretreat 阅读(190) 评论(0) 推荐(0) 编辑
摘要:输出 阅读全文
posted @ 2019-10-19 18:48 anobscureretreat 阅读(153) 评论(0) 推荐(0) 编辑