drjava

流行的JAVA IDE,你都用过哪几款?

て烟熏妆下的殇ゞ 提交于 2020-08-06 19:46:00
  每一个Java程序员应该都有一款自己了解的IDE,挑选一款好的JavaIDE能够大大进步程序员的编程功率,一起有些IDE还供给的各式各样的辅助性功用,让人感觉写起代码能够飞起来!   本文收集整理了几个目前来说比较盛行和热门的JavaIDE,以供读者参阅!   IntelliJ   毋庸置疑,IntelliJ目前来说应该是JavaIDE里面最受欢迎的,也是许许多多Java程序员公认的最好的IDE。能够说运用IntelliJ你将享受到十分高效的Java项目开发,让程序员在一些惯例耗时的工作中解放出来,开发功率将得到十分大的进步。   主要有以下这些特色:   智能代码弥补完结基于结构的帮忙高效的生产力简易的版别控制Maven项目内置功用数据流剖析内联调试器Eclipse   Eclipse作为曾经JavaIDE的王者,当然现在也仍然是最终欢迎的JAVAIDE之一,Eclipse具有十分活泼的社区以及许多开源插件,还有一些十分实用的开发东西。   Eclipse具有许多十分有用的特性,比如代码主动构建,还有其他功用包含内置调试器、错误查看、源代码生成、代码重构。一起Eclipse是一个开源的、免费的IDE,甚至能够构建属于自己的插件来习惯你的需求。   NetBeans   NetBeans实际上是SUN公司2000年推出的,旨在构建一个世界级的JavaIDE

详解 Java 的八大基本类型,写得非常好!

六眼飞鱼酱① 提交于 2020-04-29 17:09:30
自从Java发布以来,基本数据类型就是Java语言中重要的一部分,本文就来详细介绍下每种基本类型的具体使用方法和限制。 几年前,我开始编写了一系列有关Java入门的文章,我觉得有必要将其中一些非常细节的内容单独拿出来写成文章。这样,那些入门内容就更容易理解了。首先,我来介绍一下有关Java 8中的基本类型。 如题所述,Java语言本身有8种基本类型。在下面几节中,就让我们一起来看看这8种基本类型。我将针对每种基本类型,介绍具体的使用方法和限制。 int基本类型 首先,Java的整数是32位有符号(即包括正值和负值)整数,由int关键字表示: int someNumber = 10; 当然,像所有基本类型一样,整型有自己的限制。由于它只有32位,所以其取值范围为-2147483648到2147483647。这数字很大嘛!当然,我们可以在DrJava的交互面板中用下述技巧来确认: Integer.MAX_VALUE // Prints 2,147,483,647 Integer.MIN_VALUE // Prints -2,147,483,648 自然地,对于简单的计算而言,int是最常用的整数类型。如果你需要更大的数字范围,请参照下面的long。 double基本类型 与int不同,Java的双精度类型是64位浮点数,由double关键字表示: double someNumber =

详解 Java 的八大基本类型,写得非常好!

守給你的承諾、 提交于 2020-04-29 16:51:26
自从Java发布以来,基本数据类型就是Java语言中重要的一部分,本文就来详细介绍下每种基本类型的具体使用方法和限制。 几年前,我开始编写了一系列有关Java入门的文章,我觉得有必要将其中一些非常细节的内容单独拿出来写成文章。这样,那些入门内容就更容易理解了。首先,我来介绍一下有关Java 8中的基本类型。 如题所述,Java语言本身有8种基本类型。在下面几节中,就让我们一起来看看这8种基本类型。我将针对每种基本类型,介绍具体的使用方法和限制。 int基本类型 首先,Java的整数是32位有符号(即包括正值和负值)整数,由int关键字表示: int someNumber = 10; 当然,像所有基本类型一样,整型有自己的限制。由于它只有32位,所以其取值范围为-2147483648到2147483647。这数字很大嘛!当然,我们可以在DrJava的交互面板中用下述技巧来确认: Integer.MAX_VALUE // Prints 2,147,483,647 Integer.MIN_VALUE // Prints -2,147,483,648 自然地,对于简单的计算而言,int是最常用的整数类型。如果你需要更大的数字范围,请参照下面的long。 double基本类型 与int不同,Java的双精度类型是64位浮点数,由double关键字表示: double someNumber =

“The public type must be defined in its own file” but the file name and the class name is the same

半世苍凉 提交于 2020-01-05 08:55:21
问题 import java.util.StringTokenizer; public class josimarleewords { private static String[] tokenize(String str) { StringTokenizer tokenizer = new StringTokenizer(str); String[] arr = new String[tokenizer.countTokens()]; int i = 0; while (tokenizer.hasMoreTokens()) { arr[i++] = tokenizer.nextToken(); } return arr; } public static void main(String[] args) { String[] strs = tokenize("He said, That's not a good idea."); for (String s : strs) System.out.println(s); } } 回答1: If your file is called

Java Type mismatch: cannot convert from java.lang.Object

落爺英雄遲暮 提交于 2020-01-03 03:01:48
问题 I am working out of the blue pelican java textbook and using drjava. I am currently working on the Lesson 43 Big Bucks project basically I have to use this BankAccount class: public class BankAccount { public BankAccount(String nm, double amt) { name = nm; balance = amt; } public void deposit(double dp) { balance = balance + dp; } public void withdraw(double wd) { balance = balance - wd; } public String name; public double balance; } and also creat another class that will allow me to enter

Java Type mismatch: cannot convert from java.lang.Object

為{幸葍}努か 提交于 2020-01-03 03:01:43
问题 I am working out of the blue pelican java textbook and using drjava. I am currently working on the Lesson 43 Big Bucks project basically I have to use this BankAccount class: public class BankAccount { public BankAccount(String nm, double amt) { name = nm; balance = amt; } public void deposit(double dp) { balance = balance + dp; } public void withdraw(double wd) { balance = balance - wd; } public String name; public double balance; } and also creat another class that will allow me to enter

How to check if an integer is a perfect square [duplicate]

醉酒当歌 提交于 2019-12-07 03:53:50
问题 This question already has answers here : What's a good algorithm to determine if an input is a perfect square? [duplicate] (3 answers) Closed 4 years ago . How could I write an if-then statement that checks if an inputted integer is a perfect square or not (i.e. if I took the square root, it would be an integer as well: 4, 9, 16, 25, 36, etc.) in DrJava? Thank you! 回答1: I am aware that this question already has an answer.... But just in case, this also works. int x = (int) Math.sqrt(input);

How to check if an integer is a perfect square [duplicate]

℡╲_俬逩灬. 提交于 2019-12-05 07:15:50
This question already has an answer here: What's a good algorithm to determine if an input is a perfect square? [duplicate] 3 answers How could I write an if-then statement that checks if an inputted integer is a perfect square or not (i.e. if I took the square root, it would be an integer as well: 4, 9, 16, 25, 36, etc.) in DrJava? Thank you! Jaskaranbir Singh I am aware that this question already has an answer.... But just in case, this also works. int x = (int) Math.sqrt(input); if(Math.pow(x,2) == input) //Do stuff 来源: https://stackoverflow.com/questions/34056609/how-to-check-if-an-integer

DrJava: Cannot run code using JDK8.0

百般思念 提交于 2019-12-04 04:21:37
问题 Anyone having trouble using jdk 8.0 ?? Well, I don't know why I am facing some disturbances. Not sure why , after compiling a javacode in 'drjava' while I try to run it , it says ... " Current document is out of sync with the Interactions Pane and should be recompiled ! " I tried changing the compiler from JDK 8.0 to Eclipse Compiler 0.A48 it showed the same message .. after frequently recompiling and clicking the run button rather than using the shortcut key (F2) it ran !!!! then I toogled

How to get the full fraction value of a division result in java? [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-04 02:32:21
问题 This question already has answers here : Division of integers in Java [duplicate] (7 answers) Closed 6 years ago . I am new to Java and I am using DrJava IDE for my testing. I have the following division 49700/40000 and it displays 1.0 instead of 1.2425. double t = 49700/40000; System.out.println(t); Is it something I am doing wrong? 回答1: Try, this instead: double t = 49700/40000.0; System.out.println(t); If both operands are integers the result will be an integer which will be truncated, and