简体   繁体   English

学习java的最佳方法是什么

[英]what is the best approach to learning java

I originally had a bunch of code up here but now that I am somewhat more familiar with the world of programming (no expert by any means), I would like to know from a community's perspective, the best approach to learning java the practical way, I have since (the original post) taken formal classes in C and C++, but would like to give java another chance.我最初在这里有一堆代码,但现在我对编程世界更加熟悉(无论如何都不是专家),我想从社区的角度了解以实用方式学习 java 的最佳方法,我从(原帖)开始学习 C 和 C++ 的正式课程,但想再给 java 一次机会。 I now know how to understand the java docs (at least somewhat), so that's not what I am asking, but rather what are some stepping stones or hurdles to progressively over come when learning java or any new language for that matter?我现在知道如何理解 Java 文档(至少在某种程度上),所以这不是我要问的,而是在学习 Java 或任何新语言时要逐步克服的一些垫脚石或障碍是什么?

You are doing this Passenger p = new Passenger();你正在做这个Passenger p = new Passenger(); . .

But I cannot see any class named Passenger in your code.但是我在您的代码中看不到任何名为Passenger类。 Correct the class name.更正类名。

Your code is really incomplete.你的代码真的不完整。 survivalToll() method is also not defined.也没有定义survivalToll()方法。

Variable survivor not declared.未声明变量survivor Many more are there.还有更多。

You are confused with the constructor as method.您对构造函数作为方法感到困惑。 I think you code chunk should be replaced by我认为你的代码块应该被替换

class Passenger {


    //private String[] lastNames;
    private Scanner scan;
    private String path;

    private ArrayList<String[]> passengerList;

    public Passenger(String filePath) {
        this.path = filePath;
        this.passengerList = new ArrayList<String[]>();
        this.readFile();
    }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM