maven包

    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <version>2.7.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-client</artifactId>
      <version>1.2.6</version>
    </dependency>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-streams</artifactId>
    <version>1.1.0</version>
</dependency>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>1.1.0</version>
</dependency>
 <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <version>1.9.3</version>
    </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.2.1</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>net.sf.ezmorph</groupId>
      <artifactId>ezmorph</artifactId>
      <version>1.0.6</version>
    </dependency>
    <dependency>
      <groupId>net.sf.json-lib</groupId>
      <artifactId>json-lib</artifactId>
      <version>2.2.3</version>
      <classifier>jdk15</classifier><!-- 指定jdk版本 -->
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.10</version>
    </dependency>

 

0

java learn9

final关键字:尊重原创

  • 修饰类:当用final修饰一个类时,表明这个类不能被继承。(除非这个类真的在以后不会用来继承或者出于安全的考虑,尽量不要将类设计为final类。)
  • 修饰方法:当用final修饰一个方法时,这个方法就不能被重写(override)。(类的private方法会隐式地被指定为final方法
  • 修饰变量:对于一个final变量,如果是基本数据类型的变量,则其数值一旦在初始化之后便不能更改;如果是引用类型的变量,则在对其初始化之后便不能再让其指向另一个对象。

java引用传递和值传递:

参考1:https://blog.csdn.net/zzp_403184692/article/details/8184751 详细

参考2:https://blog.csdn.net/lym152898/article/details/54411956 引用传递

参考2的文章截图见:http://gongel.top/?attachment_id=3050

class Demo
{
    private int data;
    public Demo(int data)
    {
        this.data = data;
    }
    public void setData(int data)
    {
        this.data = data;
    }
    public int getData()
    {
        return this.data;
    }
}

public class  TestDemo
{
	public static void fun(Demo temp)//*******************
    {
        temp.setData(16);
    }
    public static void main(String args [])
    {
        Demo demo = new Demo(15);
        fun(demo);
        System.out.println(demo.getData()); //answer:16
    }
    
}
class Demo
{
    private int data;
    public Demo(int data)
    {
        this.data = data;
    }
    public void setData(int data)
    {
        this.data = data;
    }
    public int getData()
    {
        return this.data;
    }
}

public class  TestDemo
{
	public static void fun(Demo temp)// ********************
    {
        temp = new Demo(16);
    }
    public static void main(String args [])
    {
        Demo demo = new Demo(15);
        fun(demo);
        System.out.println(demo.getData()); //answer:15
    }
    
}

注:

(1)“在Java里面参数传递都是按值传递”这句话的意思是:按值传递是传递的值的拷贝,按引用传递其实传递的是引用的地址值,所以统称按值传递。

(2)在Java里面只有基本类型和按照下面这种定义方式的String是按值传递,其它的都是按引用传递。就是直接使用双引号定义字符串方式:String str = “Java私塾”;

0