开始使用 Java 编程
大学开学了,我有了一个新模块,叫“JAVA”!我已经对 Visual C#、PHP 和 html 有了很好的基础知识。但我从来没有用java做过任何事情。
我们的老师是一位相当老的人,就我从第一堂课上来看,这将是一些旧的东西。在第一堂课中要做的一些代码是这样的:
/*Hello.java, Jan Geerlings, 22 august 2002*/
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello...My name is \n");
}
}
为了编译这个文件,我们必须进入命令提示符并运行“javac Hello.java”,然后运行“java Hello.java”
是:
import java.applet.Applet;
import java.awt.*;
public class Welcome extends Applet
{
public void paint(Graphics g)
{
g.drawString("Welcome... My name is .. ", 50, 20);
}
}
他给我们的另一个例子 运行一个 html,显然使用以下代码:
<applet CODE="Welcome.class" WIDTH="250" HEIGHT="150"></applet>
所以我的问题是我们使用了一个非常旧的过时文本编辑器,称为 UltraEdit,并且知道我有 Visual Studio 2010 经验,这相当麻烦: 没有自动完成功能,不好文本格式,如括号和其他东西,更糟糕的是,根本没有文本着色,除非首先编译,还有大量其他限制。
他还向我们展示了以前学生的一些期末作业。主要是一些像PACMAN这样的基础游戏!还有关于南方公园等的动画...
您能告诉我我正在处理什么样的java,以及什么是可以与Visual Studio竞争的优秀IDE吗?我访问了 Eclipse 站点,发现有相当不同的 IDE 版本,例如 JAVA EE 和 普通 JAVA。哪一种适合我的情况?
谢谢!
As the university starts, I have a new module called "JAVA"! I already have good basic knowledge with visual c#, php and html. But I have never done anything in java.
Our teacher is a rather old man and as far as I got from first class, it is going to be some old stuff. some of the codes to do in first class were like this:
/*Hello.java, Jan Geerlings, 22 august 2002*/
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello...My name is \n");
}
}
For compiling this file we had to go to command prompt and run "javac Hello.java" then "java Hello.java"
Another example he gave us was:
import java.applet.Applet;
import java.awt.*;
public class Welcome extends Applet
{
public void paint(Graphics g)
{
g.drawString("Welcome... My name is .. ", 50, 20);
}
}
And this one had to run through an html, obviously with following code:
<applet CODE="Welcome.class" WIDTH="250" HEIGHT="150"></applet>
So my question is we used a pretty old dated text editor called UltraEdit and knowing that I come from Visual Studio 2010 experience, it was quite a bit of hassle: No autocomplete, not nice text formatting like brackets and stuff and worse of all no text coloring at all unless compiled first and tons of other limitation.
He also showed us some final assignment from previous students. It was mainly some basic games like PACMAN! and an animation about southpark etc...
Would you kindly tell me what kind of java I am dealing with, and what is a good IDE that can compete with Visual Studio? I went to Eclipse site and there are quite different IDE versions like JAVA EE and normal JAVA. Which one suits my case?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您的 Java 课程教授基本的运行 Java 以及一项已被 Web 2.0 接管的技术,称为 Java Applet 。
下面的课程是运行 Java 的最基本形式,
它基本上是在控制台下运行程序。正如您稍后了解到的,许多框架提供了除
static void main(String[] args)
之外的其他入口点,特别是在服务器编程甚至 Android 的上下文中。知道一切从哪里开始总是好的。下面的课程是一个小程序:
它本来是为浏览器引入交互性的技术之一,但是 Javascript 已经成熟,Web 2.0 出现并成为主流技术。
对于 Eclipse,您现在需要基本的。从 Eclipse 站点获取最新版本,这对您来说应该足够了。如果需要,Eclipse 提供动态软件更新以获得额外的模块。
鉴于您有其他语言的经验,我建议您看一下教学大纲并浏览一下所教的内容。一旦掌握了基础知识,您应该寻找与您在其他语言中学到的类似的技术/模式,例如但不限于:
Your Java class teaches basic running Java and a technology that has been taken over by Web 2.0 called Java Applet.
The lesson below that you have below is the most basic form of running Java
It basically run the program off the console. As you learn later, a lot of frameworks provide other entry point other than
static void main(String[] args)
especially in the context of Server programming and even Android. It's always good to know where everything starts thoughThe lesson below is an applet:
It was meant to be one of the technologies that introduced interactivity to the browsers, however Javascript got matured and Web 2.0 came and took over as the mainstream technology.
For Eclipse you need the basic one for now. Get the latest version from Eclipse site, it should be enough for you. Eclipse provide dynamic software update to get additional modules if you need to.
I suggest you take a look of the syllabus and glance over what being taught given you have experience on other languages. Once you have grasped the basics, you should look for similar technology/pattern to what you have learned in other languages, such as but not limited to:
Eclipse 3.7 很可能是您想要的版本,因为您仍在做非常基本的事情。不过,从命令行开始并没有什么坏处。它将使您更好地了解事物如何组合在一起。
Eclipse 3.7 is most likely the version you want since you're still doing quite basic stuff. There is no harm whatsoever in starting with the command line though. It will give you a better appreciation of how things fit together.
Java是Java,就像C#是C#一样。只是你用它做什么才会改变。
看看Eclipse。 IMO 它是最好的 java IDE。它不像 VS 那样完美,但它在某些方面做得更好。
Java is Java just as C# is C#. Its just what you do with it that changes.
Have a look at Eclipse. IMO its the best java IDE. Its not quite a polished as VS but it does some thing better.
我推荐 NetBeans。根据我的经验,它不像 Eclipse 那样臃肿和缓慢。如果您仍在使用 php 进行开发,那么还有一个很棒的 PHP 版本,您可能会想看看。
I would recommend NetBeans. In my experience it's not as bloated and slow as Eclipse. There's a great PHP-version as well that you might want to look at if you still develop in php.