`

Cannot make a static reference to the non-static field email

阅读更多
     之所以会报Cannot make a static reference to the non-static field email这个错,是因为在静态方法中,不能直接访问非静态成员(包括方法和变量)。因为,非静态的变量是依赖于对象存在的,对象必须实例化之后,它的变量才会在内存中存在。
       因此,这个东西解决起来特别简单,第一种,可以把变量改成静态的。第二种,先实例化对象,然后使用对象名.变量名来调用即可。
分享到:
评论

相关推荐

    non-static member function cannot be static(解决方案).md

    non-static member function cannot be static(解决方案).md

    non-const lvalue reference cannot bind to rvalue(解决方案).md

    non-const lvalue reference cannot bind to rvalue(解决方案).md

    [EN]emWin534

    emWin 设计用于提供高效且独立于处理器和显示控制器的图形用户界面,用于任何使用图形显示进行 操作的应用。它与单任务和多任务环境、专用操作系统或具有任何商业RTOS 兼容,emWin 的发货 形式为C 语言源代码。...

    acpi控制笔记本风扇转速

    The disassembler now emits a comment if a buffer appears to be a ResourceTemplate, but cannot be disassembled as such because the EndTag does not appear at the very end of the buffer. AcpiExec - ...

    The connected J-Link is defective,Proper operation cannot be guaranteed

    解决 The connected J-Link is defective,Proper operation cannot be guaranteed keil5版本比较高时debug会出现以上错误,替换安装文件下的segger 可以解决

    SSD7 选择题。Multiple-Choice

    (a) the name of the table and the amount of storage space to be allocated to the table (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the ...

    PC-lint 9.0 -- Gimpel.Software.PC-lint.9.0a

    You have permission to print out the Reference Manual (or other related documentation) in whole or in part in support of the use of this software. ------ Support for Microsoft through Visual ...

    MS-DOS 5.0

    to the User's Guide and Reference. For information about using applications with MS-DOS 5.0, see the APPNOTE.TXT file. 2. SOLVING SETUP PROBLEMS ========================= 2.1 Priam and Everex ...

    A-Practical-Guide-to-LATEX-Tips.pdf

    but to give a quick reference to all the tips and tricks that can be used if you are encountering a (difficult) problem, or simply facing a question which you cannot find the answer to. I consider ...

    嵌入式开发 KEIL+JLINK调试解决调试异常的问题 the connected J-link is defective.

    the connected J-link is defective. Proper operation cannot be guaranteed Jlink information Firmware J-link ARM V8 这个问题经常导致调试过程中频繁退出,或无法停止,无法reset,单步调试异常等现象 把...

    make-3.82.tar.gz

    Some systems' Make programs are broken and cannot process the Makefile for GNU Make. If you get errors from your system's Make when building GNU Make, try using `build.sh' instead. GNU Make is free ...

    file-5.15-mips32r1-linux-static.tar.xz

    # ./configure --host=arm-unknown-linux-uclibcgnueabi --prefix=/usr --disable-warnings --disable-shared --enable-static LDFLAGS="--static -s" 2、mips平台 # ./configure --host=mips-unknown-linux-uclibc ...

    Senfore_DragDrop_v4.1

    to ask for help via email, but I cannot guarantee that I will have time to help you or even reply to your mail. If you absolytely can't live without my help, you can alway try bribing me. You can ...

    markdown_to_asciidoc-1.0.jar

    mvn install:install-file -DgroupId=nl.jworks.markdown_to_asciidoc -DartifactId=markdown_to_asciidoc -Dversion=1.0 -Dpackaging=jar -Dfile=C:\Users\lizz\Downloads\markdown_to_asciidoc-1.0.jar

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Correct use of header files can make a huge difference to the readability, size and performance of your code. The following rules will guide you through the various pitfalls of using header files. ...

    Git-2.21.0-64-bit.zip

    * A new tag.gpgSign configuration variable turns "git tag -a" into "git tag -s". * "git multi-pack-index" learned expire and repack subcommands. * "git blame" learned to "ignore" commits in the ...

    计算机网络第六版答案

    Most packet-switched networks today (including the Internet) cannot make any end-to-end guarantees for bandwidth. FDM requires sophisticated analog hardware to shift signal into appropriate frequency...

    The MySQL server is running with the --read-only option so it cannot execute this statement

    MySQL服务器在运行时可能由于配置了`--read-only`选项,导致无法执行写入操作,从而出现"1209 - The MySQL server is running with the --read-only option so it cannot execute this statement"的错误。...

    a project model for the FreeBSD Project.7z

    Often used more narrowly in reference to an external deliverable, which is a deliverable that is subject to approval by the project sponsor or customer” by [PMI, 2000]. Examples of outcomes are a ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    Now it is possible to define is the drawing take place via WMPaint or via the PaintTo direct call (if rcPaint contain non-empty rectangle then WMPaint in progress). - FIX: The TFlexPanel.FPaintCache ...

Global site tag (gtag.js) - Google Analytics