011 day11java use eclipse

11.01_Java development tools (common development tools introduced) (understand)

  • A: operating system comes with Notepad software
  • B: Senior Notepad software
  • C: integrated development environment (IDE)
    • (Integrated Development Environment)
  • D: Eclipse and MyEclipse difference
    • a: Eclipse IDE is a scalable open source.
    • b: Eclipse features described
      • free
      • Pure Java language
      • Free installation
      • Scalability
    • c:MyEclipse
      • Eclipse on the basis of additional plug-in, plug-charge
      • Provide a powerful system architecture development platform WEB
  • E: Download http://eclipse.org/
    • org is a non-profit organization
  • F: Installation
    • Green version decompression can be used (Eclipse)
    • Double-click the installation version of the run, all the way next to (JDK)
  • G: Uninstall
    • Green version folder to delete
    • Professional installation uninstall the software version of the Control Panel Add or Remove Programs

11.02_Java development tools (Eclipse cases and finished in HelloWorld) (understand)

  • A: Select Workspace
    • Workspace fact, we write the source code directory where
  • B: HelloWorld with Eclipse to complete a case
    • Code to the project as the basic unit
    • Create a project
    • Creating a Package
    • Create a class
    • Write code
  • C: Compiling and running
  • D: Eclipse is finished
    • Eclipse3.5 from the start, the installation directory will have one dropins directory, as long as the plug-in to unzip into the directory.
    • Similarly, this approach is particularly convenient to uninstall plug-ins, recommend this approach
  • E: grammar checker Tips
    • Red wavy line
      • It must be addressed, otherwise the compiler pass
    • Yellow wavy line
      • You can pay any attention to him

11.03_Java development tools (Eclipse of windows and views Overview) (understand)

  • A: Each window is called a window substantially form
    • PackageExplorer show the project structure, packages, classes, and resources
    • Outline display structure class, easy to find, identify, modify
    • Console program running results appear in the window
    • After F4 Hierarchy display Java inheritance hierarchy, select the class
  • B: Some combinations of the view window is formed
    • Java view
    • Debug view

11.04_Java development tools (Eclipse workspace basic configuration) (master)

  • A: compile and run the program configuration environment (generally do not change)
    • window -- Preferences -- Java
    • Compiler environment: Compiler highest version is selected by default.
    • Operating Environment: Installed JREs will find that the default JDK you installed. Recommended to configure the Java environment variables.
    • problem:
      • Low compile, run high. can.
      • High compile, run low. Not.
      • Unanimously recommended, compile and run version.
  • B: How to get rid of the default comment?
    • window -- Preferences -- Java -- Code Style -- Code Templates
    • Select what you do not want, by right of the Edit editor.
    • NOTE: Please delete the comment section only, do not delete the comment section.
  • C: display line numbers and hidden
    • Display: empty area to the left of most of the code area, right - Show Line Numbers can be.
    • Hidden: The above action to do it again.
  • D: font size and color
    • a: Java code region of the font size and color:
      • window -- Preferences -- General -- Appearance -- Colors And Fonts --Java修改 -- Java Edit Text Font
    • b: Console
      • window -- Preferences -- General -- Appearance -- Colors And Fonts -- Debug -- Console font
    • c: Other documents
      • window -- Preferences -- General -- Appearance -- Colors And Fonts -- Basic -- Text Font
  • E: Form to mess up, how to do?
    • window -- Reset Perspective
  • F: Can not find the console, how to do?
    • Window--Show View—Console
  • G: Cancel prompt suspension
    • window - Preferences - Java - Editor - Hovers. Combined Hover the right to remove the hook.
    • Such a suspension block of code will not automatically appear. If you want to see the tips, the cursor is over the code, according to F2.

11.05_Java development tools (use content assist key Eclipse) (master)

  • A: Alt + / role play tips
  • B: main + alt + /, syso + alt + /, given other tips
  • C: complementary output statement, select the part you want to export, alt + / to select the last item
  • C: define your own alt + /
    • windows--perference-Java-Editor-Templates--New

11.06_Java development tools (Eclipse use shortcut keys) (master)

  • A: New ctrl + n
  • B: Formatting ctrl + shift + f
  • C: import package ctrl + shift + o
  • D:注释 ctrl+/,ctrl+shift+/,ctrl+shift+\
  • E: Code Code alt + move the selection up / down arrow
  • F: View source select the class name (F3 or Ctrl + mouse click)
  • G: Find specific class ctrl + shift + t
  • H: DETAILED find specific class ctrl + o
  • I: ctrl + 1, generated according to the type of data to the right of the left, to a method for generating recommendations
  • J: remove the code ctrl + d
  • K: Extraction Method alt + shift + m
  • L: renamed alt + shift + r

11.07_Java development tools (Eclipse How to improve development efficiency) (master)

  • alt + shift + s
  • A: automatically generated constructor
  • B: automatically generate the get / set
package com.heima;

public class Person {

        private String name;
        private int age;
        
        public Person() {  //alt + shift + s 再+c 生成空参构造
            super();
            
        }
        public Person(String name, int age) {   //alt + shift + s 再+0 根据本地数据生成有参构造
            super();
            this.name = name;
            this.age = age;
        }
        public String getName() {   //alt + shift + s 再+r 生成get,set方法
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getAge() {
            return age;
        }
        public void setAge(int age) {
            this.age = age;
        }
        
        

11.08_Java development tools (Eclipse students in a class and its standard test) (master)

  • A: Case presentation
    • For standard class and student test Eclipse

11.09_Java development tools (Eclipse interface in an abstract class concrete class code embodied) (master)

  • A: Case presentation
    • DETAILED abstract class implements the interface class code with Eclipse

11.10_Java development tools (Eclipse how to generate jar package and imported into the project) (understand)

  • A: What jar that?
    • jar is compressed multiple class files.
  • B: jar what's the use?
    • Something written by someone else
  • C: jar packaging
    • Select the project - Right --Export - Java - Jar-- own specify a path and a name --Finish
  • D: Import jar package
    • Copied to the project and add the path to the build path.

11.11_Java development tools (Eclipse how to remove items and imported items) (master)

  • A: Remove items
    • Select the project - Right - Delete
      • Deleted from the project area
      • Deleted from the hard
  • B: Import project
    • Right import found in the project area
    • Find General, expand and find
    • Existing Projects into Workspace
    • Click next, and then select the item you want to import
    • Note: The selection here is the project name

11.12_Java development tools (Eclipse using the basic breakpoint debugging) (understand)

  • A: The role of Debug
    • Debugger
    • View program execution flow
  • B: how to view the execution process
    • What is the breakpoint:

      • It is a mark where to start.
    • How to set breakpoints:

      • Where you want to see the program, you double-click to the left of the effective programs.
    • Where to set breakpoints:

      • Where is the point where not.
      • Currently: We are effectively applied to the first sentence of each method.
    • How to run the setup program after the break:

      • Right - Debug as - Java Application
    • Look what areas:

      • Debug: Local breakpoint test
        • In this place, remember F6, or click can be. Time to see the implementation of a line.
      • Variables: Variable viewer changes
      • ForDemo: View the source file
      • Console: Console
    • How to break:

      • a: Double-click again to
      • b: find Debug view, Variables interface, find Breakpoints, and click, and then see all the breakpoints, and finally click on the two-pronged.

11.13_Java development tools (Eclipse view in Java parameter passing problem) (understand)

  • A: Breakpoint demo
    • Breakpoints view in Java parameter passing problem

11.14_ common objects (API Overview) (understand)

  • A:API(Application Programming Interface)
    • Application Programming Interface
  • B:Java API
    • Java class is available to us to use these classes to achieve the underlying package up,
    • We do not need to be concerned about how these classes are implemented, only we need to learn how to use these classes.

11.15_ common objects (overview of the Object class) (understand)

  • A: Object Class Overview
    • Class hierarchy root class
    • All classes are directly or indirectly inherited from class
  • B: Constructor
    • public Object()
    • Recall why object-oriented:
    • The default constructor of a subclass of the visit is no argument constructor of the parent class method

11.16_ common objects (hashCode Object class () method) (understand)

  • A: Case presentation
    • public int hashCode()
    • a: Returns the hash code value for this object. By default, this method can be calculated based on the address of the object.
    • b: different objects, hashCode () will generally not identical. However, an object of the same hashCode () value is certainly the same.

11.17_ common objects (getClass Object class () method) (grasp at the time of reflection)

  • A: Case presentation
    • public final Class getClass()
    • a: Returns the runtime class of this Object.
    • b: by a method in class Class acquires full class name of the real object.
      • public String getName()

11.18_ Common Object (toString Object class () method) (master)

  • A: Case presentation

    • public String toString()
    • a: Returns a string representation of the object.

  • ​ public Stirng toString() {
    ​ return name + "," + age;
    ​ }

    • B: its value is equal to:
      • getClass().getName() + "@" + Integer.toHexString(hashCode())
    • c: Since the data in the default does not make sense to us, it is generally recommended override this method.
  • B: Final

    • Automatic generated

11.19_ common objects (equals Object class () method) (master)

  • A: Case presentation
    • a: some other object indicating whether this object is "equal."
    • b: the case of default the comparison is a reference to the object are the same.
    • c: Due to quote comparison does not make sense, and is generally recommended to override this method.

11.20_ common objects (the difference between == and the equals method number) (master)

  • == number is a comparison operator, may be more basic data types, data types may be compared with a reference, the basic data type is a value comparison, is a comparison reference data type address value
  • equals method is a method that can only compare reference data types, methods, all objects will inherit the Object class, if the equals method of the Object class does not override, and the equals method number == comparison reference data types without distinction, rewrite after the equals method to compare the properties of the object

Reproduced in: https: //www.jianshu.com/p/4e43c12740f9

Guess you like

Origin blog.csdn.net/weixin_34383618/article/details/91161915
011