Tag Archives: class

Error in creating a new class file for Android studio

Error in creating a new class file

After Baidu, the reason is: there is no class template

Solution: in file > settings> File and Code Templates> Add the following code to class:

#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
 
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
 
#if (${VISIBILITY} == "PUBLIC")public #end #if (${ABSTRACT} == "TRUE")abstract #end #if (${FINAL} == "TRUE")final #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "")implements ${INTERFACES} #end {
}

 

Invalid use of incomplete type struct or class solution

Why can’t you stop buying 618?From the technical dimension to explore>>>

Question 1: invalid use of incomplete type

This problem indicates that the compiler does not know the specific implementation of struct or class used. It usually occurs in the following cases: suppose we have a class some defined in some. H, implemented in some. CPP, and we need to use the method of some in other. CPP, so we can declare a class some in other. H, and declare the method to be used, This will lead to the above problem. The way to solve this problem is to include some. H in other.cpp, so that the compiler will find the specific definition of class some according to the header file, and the problem will be solved