Inner内部类,OuterClassName.InnerClassName 5C
public class OuterDemo02 {

    /**
     * 内部类
     *
     */
    class InnerDemo02{


    }

    public InnerDemo02 createInner() {
        return new InnerDemo02();
    }

    public static void main(String args[]) {
        OuterDemo02 outer = new OuterDemo02();
        InnerDemo02 inner = outer.new InnerDemo02();

        OuterDemo02.InnerDemo02 inner2 = outer.new InnerDemo02();

        outer.createInner();
    }

}

InnerDemo02 inner = outer.new InnerDemo02();

OuterDemo02.InnerDemo02 inner2 = outer.new InnerDemo02()
的区别在哪里,java编程思想有句话“如果想从外部类的非静态方法之外的任意位置创建某个内部类的对象,那么必须具体指明这个对象的类型:OuterClassName.InnerClassName”。这句话要怎么理解?

5个回答

公开的内部类就相当于公开类,比如一个公开类A有一个公开的内部类B,对于编译器来说他有两个单独的公开类,虽然这个类B是放在类A里,但是你可以把它当成与类A同等级的

内部类是在外部类中定义的,所以可以说内部类是外部类的一部分,像你说的OuterDemo02.InnerDemo02与 InnerDemo02可以等同起来。我是这样理解的,如果有什么问题的,请指出。

u012734723
bluesnail95 如果想从外部类的非静态方法之外的任意位置创建某个内部类的对象,那么必须具体指明这个对象的类型:OuterClassName.InnerClassName 只是不理解编程思想里面的这句话,但是不在前面加外部类也是对的。还是编程思想这句话有误?
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
使用内部类时,编译提示限定的新静态类

class OutClass{ static class InnerClass{ String s1 = "这是内部类的实例属性"; InnerClass(){ System.out.println("创建内部类对象!"); } void innerTest(){ System.out.println("这是内部类的test方法!"); } } void accessInner(){ System.out.println(new InnerClass().s1); } } class InnerClassAccess{ public static void main(String[] args){ OutClass oc = new OutClass(); oc.new InnerClass().innerTest(); } } 编译时提示限定的新静态类,请问如何正确访问静态内部类中的非静态方法?

一道java题目,请求帮助

设有一个类的代码如下: class outer { public class Inner1 { } public static class Inner2 { } } 则在另一个类的代码中,下列语句正确的是(  )。 A.Outer.Inner1 obj = new Outter.Inner1(); B.Outer.Inner2 obj = new Outer.Inner2(); C.Outer.Inner1 obj = new Outer.Inner1().new Inner1(); D.Outer.Inner2 obj = new Outer().new Inner2();

Error:warning: Ignoring InnerClasses

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.diffdev.a.b) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.diffdev.a.c) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$ActivityLifecycleCb$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$ActivityLifecycleCb$2) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Information:BUILD SUCCESSFUL Information:Total time: 36.571 secs Information:40 errors Information:0 warnings Information:See complete output in console 大神们看下这个怎么解决, multiDexEnabled true,这个我已经加上了,application也加上了,上面的错误有一个com.tencent.mm.opensdk.diffdev.a.b提示,我是之前做微信第三方登陆加了他们的库,不知道是不是这个原因

Hql 中关于 count(*) 和 inner join fetch 联合使用的问题!急。。。

hql 如下: String hql="from FcInstrateAdjust a inner join fetch a.fcAcc inner join fetch a.fcAcc.btNet inner join fetch a.fcInterestType where 1=1 "; 在构建Query对象的时候报错: 代码片段: Query query = getSession().createQuery( "select count(*) " + hql); 错误信息为: query specified join fetching, but the owner of the fetched association was not present in the select list ------------------------------ 想知道原因,及 解决方法,谢谢大家!

询问关于最新版本这个的多表关联查询JoinType.INNER_JOIN该如何写,有类似的例子最好。

我写了这句会报错 Join<AppInfoPO, DictValuePO> appInfoJoin = Root.join( root.getModel().getSingularAttribute("dictValue", DictValuePO.class), JoinType.INNER_JOIN); 报出的异常如图所示,具体依赖版本为 compile 'org.springframework.boot:spring-boot-starter-data-jpa:1.4.2.RELEASE' ![图片说明](https://img-ask.csdn.net/upload/201612/29/1482996722_858309.png)

关于JAVA含有内部类的类编译成class后修改Class文件出现错误

JAVA类编译后是class文件,编译后生成了getname.class,和getname$1.class.这里我没有源码,我修改了getname.class中的一个System.out.print中输出的内容,比如原来输出wang,我使用工具将输出内容改成了li,文件反编译后与原来没有修改时的内容一致,但是在TOMCAT启动的时候报错了,报错内容为java.lang.ClassFormatError: Wrong InnerClasses attribute length in class file. 这里应该如何处理才不会出错,或者InnerClasses attribute length在class中何处修改,使用什么工具可以修改。

error LNK1104: cannot open word2vec_inner.pyd'

windons实现Yang Liu的Topical Word Embeddings时,运行错误 TWE\test.py: import gensim sentence_word = gensim.models.word2vec.LineSentence("tmp/word.file") TWE\gensim\models\word2vec.py: try: raise ImportError # ignore for now from gensim_addons.models.word2vec_inner import train_sentence_sg, train_sentence_cbow, FAST_VERSION, train_sentence_topic except ImportError: try: # try to compile and use the faster cython version import pyximport print 'import pyximport' models_dir = os.path.dirname(__file__) or os.getcwd() print 'models_dir' pyximport.install(setup_args={"include_dirs": [models_dir, get_include()]}) print 'pyximport' # is the follow code's problem from word2vec_inner import train_sentence_sg, train_sentence_cbow, FAST_VERSION, train_sentence_topic print 'from word2vec' except: print 'except2' # failed... fall back to plain numpy (20-80x slower training than the above) FAST_VERSION = -1 def train_sentence_sg(model, sentence, alpha, work=None): ... def train_sentence_cbow(model, sentence, alpha, work=None, neu1=None): ... class Word2Vec(utils.SaveLoad): def __init__(self, sentences=None, size=100, alpha=0.025, window=5, min_count=5,sample=0, seed=1, workers=1, min_alpha=0.0001, sg=1, hs=1, negative=0, cbow_mean=0): ... def train(self, sentences, total_words=None, word_count=0, chunksize=100): if FAST_VERSION < 0: import warnings warnings.warn("Cython compilation failed, training will be slow. Do you have Cython installed? `pip install cython`") logger.info("training model with %i workers on %i vocabulary and %i features, " "using 'skipgram'=%s 'hierarchical softmax'=%s 'subsample'=%s and 'negative sampling'=%s" % (self.workers, len(self.vocab), self.layer1_size, self.sg, self.hs, self.sample, self.negative)) ... def worker_train(): if self.sg: job_words = sum(train_sentence_topic(self, sentence, alpha, work) for sentence in job) else: job_words = sum(train_sentence_cbow(self, sentence, alpha, work, neu1) for sentence in job) ... 运行train.py,出现以下错误: E:\Python27\python.exe D:/pycharm/TWE/TWE1/train.py wordmap.txt model-final.tassign 100 import pyximport models_dir pyximport word2vec_inner.c e:\python27\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION C:\Users\hp\.pyxbld\temp.win32-2.7\Release\pyrex\gensim\models\word2vec_inner.c(15079) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data C:\Users\hp\.pyxbld\temp.win32-2.7\Release\pyrex\gensim\models\word2vec_inner.c(15085) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data LINK : fatal error LNK1104: cannot open file 'C:\Users\hp\.pyxbld\lib.win32-2.7\gensim\models\word2vec_inner.pyd' except2 Training the word vector... D:\pycharm\TWE\TWE1\gensim\models\word2vec.py:410: UserWarning: Cython compilation failed, training will be slow. Do you have Cython installed? `pip install cython` warnings.warn("Cython compilation failed, training will be slow. Do you have Cython installed? `pip install cython`") PROGRESS: at 100.00% words, alpha 0.02500, 2556 words/s Training the topic vector... D:\pycharm\TWE\TWE1\gensim\models\word2vec.py:882: UserWarning: Cython compilation failed, training will be slow. Do you have Cython installed? `pip install cython` warnings.warn("Cython compilation failed, training will be slow. Do you have Cython installed? `pip install cython`") Exception in thread Thread-23: Traceback (most recent call last): File "E:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "E:\Python27\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "D:\pycharm\TWE\TWE1\gensim\models\word2vec.py", line 909, in worker_train job_words = sum(train_sentence_topic(self, sentence, alpha, work) for sentence in job) File "D:\pycharm\TWE\TWE1\gensim\models\word2vec.py", line 909, in <genexpr> job_words = sum(train_sentence_topic(self, sentence, alpha, work) for sentence in job) NameError: global name 'train_sentence_topic' is not defined Saving the topic vectors... Saving the word vectors... Process finished with exit code 0 我已经安装了Microsoft Visual C++ Compiler for Python 2.7和cython,而且我也用一个小的程序测试了cython是正确编译和安装了的,但是还是出现问题。按照这个博客上的测试了cython,然后按照一个博客运行的TWE程序。看了好久,总结了应该是在word2vec.py最开始导入不了train_sentence_sg, train_sentence_cbow, FAST_VERSION, train_sentence_to。但是为什么导入不了,总觉得不应该,我成功编译了pyx文件的,cython也是正确安装了的。到底是什么问题,有大神遇到过这个问题的吗?求大神帮忙,谢谢!急急急,在线等

java内部类以及指针指向问题

![图片说明](https://img-ask.csdn.net/upload/201611/25/1480037697_745947.png) ![图片说明](https://img-ask.csdn.net/upload/201611/25/1480037707_727371.png) 第一个图是我的SourceType类,是一个普通的成员内部类,一个get单例模式 第二幅图是我的Test类,a= sourceType.getInnerClass()的时候已经实例化,所以a=b是因为单例问题,但是sourceType.new InnerClass().display();的时候又调用一次内部类的构造方法,为什么他的hashcode还是跟a,b相等,不是应该调用构造方法就创造一个新的对象么?不理解为什么

大神帮我看下这串关于java匿名内部类有什么问题没

这串代码是引自一个学习博客:http://blog.csdn.net/chenssy/article/details/13170015 ``` package testNote1; public class OutClass { public InnerClass getInnerClass(final int age,final String name){ return new InnerClass() { int age_ ; String name_; //构造代码块完成初始化工作 { if(0 < age && age < 200){ age_ = age; name_ = name; } } public String getName() { return name_; } public int getAge() { return age_; } }; } public static void main(String[] args) { OutClass out = new OutClass(); InnerClass inner_1 = out.getInnerClass(201, "chenssy"); System.out.println(inner_1.getName()); InnerClass inner_2 = out.getInnerClass(23, "chenssy"); System.out.println(inner_2.getName()); } } ``` 我在想上面的代码是不是少了定义类,如: ``` package testNote1; public class InnerClass { public String name_; public int age_; public String getName() { return name_; } public int getAge() { return age_; } } ``` 如果是这样的话,代码中的内部类中下图的部分是否定义多余了: ![图片说明](https://img-ask.csdn.net/upload/201608/13/1471076274_519855.png)

maven工程报以下错误,初始化失败、监听器出现问题等 这是怎么回事?

启动maven工程后报以下错误 09:24:39,799 ERROR ContextLoader:316 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]: Cannot create inner bean 'com.github.pagehelper.PageHelper#3bc66802' of type [com.github.pagehelper.PageHelper] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageHelper] for bean with name 'com.github.pagehelper.PageHelper#3bc66802' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:327) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedArray(BeanDefinitionValueResolver.java:389) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:155) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1605) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1357) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageHelper] for bean with name 'com.github.pagehelper.PageHelper#3bc66802' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1380) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:312) ... 26 more Caused by: java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) at org.springframework.util.ClassUtils.forName(ClassUtils.java:274) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:437) at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1428) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1372) ... 28 more 十月 17, 2019 9:24:39 上午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]: Cannot create inner bean 'com.github.pagehelper.PageHelper#3bc66802' of type [com.github.pagehelper.PageHelper] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageHelper] for bean with name 'com.github.pagehelper.PageHelper#3bc66802' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:327) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedArray(BeanDefinitionValueResolver.java:389) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:155) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1605) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1357) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageHelper] for bean with name 'com.github.pagehelper.PageHelper#3bc66802' defined in URL [jar:file:/E:/repository_boot/com/yezi/yezi_common_service/1.0-SNAPSHOT/yezi_common_service-1.0-SNAPSHOT.jar!/applicationContext-dao.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1380) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:312) ... 26 more Caused by: java.lang.ClassNotFoundException: com.github.pagehelper.PageHelper at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) at org.springframework.util.ClassUtils.forName(ClassUtils.java:274) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:437) at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1428) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1372) ... 28 more 十月 17, 2019 9:24:39 上午 org.apache.catalina.core.StandardContext startInternal 严重: Error listenerStart 十月 17, 2019 9:24:39 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [] startup failed due to previous errors 十月 17, 2019 9:24:39 上午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 十月 17, 2019 9:24:39 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 十月 17, 2019 9:24:39 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 十月 17, 2019 9:24:39 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [] registered the JDBC driver [com.alibaba.druid.mock.MockDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 十月 17, 2019 9:24:39 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. 十月 17, 2019 9:24:39 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-9101"] 十月 17, 2019 9:24:44 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:24:49 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:24:54 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:24:59 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:04 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:09 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:14 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:19 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:24 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:29 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:34 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:39 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:44 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:49 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:54 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:25:59 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:04 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:09 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:14 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:19 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:24 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 十月 17, 2019 9:26:29 上午 org.apache.catalina.loader.WebappClassLoader findResourceInternal 信息: Illegal access: this web application instance has been stopped already. Could not load . The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. ``` ```

SpringMvc 拦截器(Maven工程)

我在web工程里面引入了一个common的工程,把common工程中的一个的类作为拦截器,但是启动的时候会报错 Cannot create inner bean 'XXX.XXX.common.interceptor.LogInterceptor#0',我在配置文件里面都能点到那个类里面. spring配置如下: mvc:mapping path="/*"/ bean class="XXX.XXX.common.interceptor.LogInterceptor"/bean /mvc:interceptor ( 尖括号都去掉了,要不看不到代码) 同样的配置,我把改类放到web工程下就是OK的,难道spring注册bean的时候,不能注册引用工程的类么

内部类,外部类与jvm的关系

使用 Outer.Inner inner = new Outer().new Inner()创建对象时,Inner类中没有使用Outer中的属性和方法时,外部类对象是否会被jvm的垃圾回收机制回收(可达性分析中没有人连接着外部类对象,但有人连接着内部类对象)

静态内部类创建对象相关问题

为什么静态内部类创建对象的时候不需要外部类的对象。例如: Outer22.Inner22 inner=new Outer22.Inner();

怎样调用匿名内部类及内部类的参数

我最近在使用一个安卓图表插件androidplot,看到别人很多代码都使用了匿名内部类,像这样: ``` _ratePlot.setRangeValueFormat(new Format() { @Override public StringBuffer format(Object obj, @NonNull StringBuffer toAppendTo, @NonNull FieldPosition pos) { double val = ((Number) obj).doubleValue(); double maxY = _ratePlot.getCalculatedMaxY().doubleValue(); if (val == 0 || maxY < finalK) { return new DecimalFormat("0").format(val, toAppendTo, pos); } else if (maxY < finalK * finalK) { if (val < 10 * finalK) return new DecimalFormat("0.0 k").format(val / (1000), toAppendTo, pos); else return new DecimalFormat("0 k").format(val / (1000), toAppendTo, pos); } else { if (val < 10 * finalK * finalK) return new DecimalFormat("0.0 M").format(val / (finalK * finalK), toAppendTo, pos); else return new DecimalFormat("0 M").format(val / (finalK * finalK), toAppendTo, pos); } } @Override public Object parseObject(String source, @NonNull ParsePosition pos) { return null; } }); ``` 但是我只看到了定义这个匿名内部类,没有看到在哪里调用,所以有没有大神知道怎样确定参数obj的值,也就是val到底是多少呢? 完整代码: ``` package net.i2p.android.router.stats; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.androidplot.xy.BarFormatter; import com.androidplot.xy.BarRenderer; import com.androidplot.xy.BoundaryMode; import com.androidplot.xy.XYPlot; import com.androidplot.xy.XYSeries; import com.androidplot.xy.XYStepMode; import net.i2p.android.router.I2PFragmentBase; import net.i2p.android.router.R; import net.i2p.android.router.service.StatSummarizer; import net.i2p.android.router.service.SummaryListener; import net.i2p.android.router.util.Util; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.FieldPosition; import java.text.Format; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Observable; import java.util.Observer; public class RateGraphFragment extends I2PFragmentBase { // redraws a plot whenever an update is received: private class MyPlotUpdater implements Observer { public void update(Observable o, Object arg) { Util.d("Redrawing plot"); updatePlot(); } } public static final String RATE_NAME = "rate_name"; public static final String RATE_PERIOD = "rate_period"; private Handler _handler; private SetupTask _setupTask; private SummaryListener _listener; private XYPlot _ratePlot; private MyPlotUpdater _plotUpdater; private int _k; public static RateGraphFragment newInstance(String name, long period) { RateGraphFragment f = new RateGraphFragment(); Bundle args = new Bundle(); args.putString(RATE_NAME, name); args.putLong(RATE_PERIOD, period); f.setArguments(args); return f; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); _handler = new Handler(); _setupTask = new SetupTask(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_graph, container, false); _ratePlot = (XYPlot) v.findViewById(R.id.rate_stat_plot); return v; } @Override public void onStart() { super.onStart(); _handler.removeCallbacks(_setupTask); _handler.postDelayed(_setupTask, 100); } @Override public void onStop() { super.onStop(); if (_listener != null && _plotUpdater != null) { Util.d("Removing plot updater from listener"); _listener.removeObserver(_plotUpdater); } _handler.removeCallbacks(_setupTask); } private class SetupTask implements Runnable { public void run() { String rateName = getArguments().getString(RATE_NAME); long period = getArguments().getLong(RATE_PERIOD); _k = 1000; if (rateName.startsWith("bw.") || rateName.contains("Size") || rateName.contains("Bps") || rateName.contains("memory")) _k = 1024; Util.d("Setting up " + rateName + "." + period); if (StatSummarizer.instance() == null) { Util.d("StatSummarizer is null, delaying setup"); _handler.postDelayed(this, 1000); return; } _listener = StatSummarizer.instance().getListener(rateName, period); if (_listener == null) { Util.d("Listener is null, delaying setup"); _handler.postDelayed(this, 1000); return; } XYSeries rateSeries = _listener.getSeries(); _plotUpdater = new MyPlotUpdater(); _ratePlot.addSeries(rateSeries, new BarFormatter(Color.argb(200, 0, 80, 0), Color.argb(200, 0, 80, 0))); _ratePlot.calculateMinMaxVals(); long maxX = _ratePlot.getCalculatedMaxX().longValue(); Util.d("Adding plot updater to listener"); _listener.addObserver(_plotUpdater); // Only one line, so hide the legend _ratePlot.getLegendWidget().setVisible(false); BarRenderer renderer = (BarRenderer) _ratePlot.getRenderer(BarRenderer.class); renderer.setBarWidthStyle(BarRenderer.BarWidthStyle.VARIABLE_WIDTH); renderer.setBarGap(0); _ratePlot.setDomainUpperBoundary(maxX, BoundaryMode.GROW); _ratePlot.setDomainStep(XYStepMode.INCREMENT_BY_VAL, 15 * 60 * 1000); _ratePlot.setTicksPerDomainLabel(4); _ratePlot.setRangeLowerBoundary(0, BoundaryMode.FIXED); _ratePlot.setTicksPerRangeLabel(5); _ratePlot.setDomainValueFormat(new Format() { private DateFormat dateFormat = SimpleDateFormat.getTimeInstance(DateFormat.SHORT); @Override public StringBuffer format(Object obj, @NonNull StringBuffer toAppendTo, @NonNull FieldPosition pos) { long when = ((Number) obj).longValue(); Date date = new Date(when); return dateFormat.format(date, toAppendTo, pos); } @Override public Object parseObject(String s, @NonNull ParsePosition parsePosition) { return null; } }); final int finalK = _k; _ratePlot.setRangeValueFormat(new Format() { @Override public StringBuffer format(Object obj, @NonNull StringBuffer toAppendTo, @NonNull FieldPosition pos) { double val = ((Number) obj).doubleValue(); double maxY = _ratePlot.getCalculatedMaxY().doubleValue(); if (val == 0 || maxY < finalK) { return new DecimalFormat("0").format(val, toAppendTo, pos); } else if (maxY < finalK * finalK) { if (val < 10 * finalK) return new DecimalFormat("0.0 k").format(val / (1000), toAppendTo, pos); else return new DecimalFormat("0 k").format(val / (1000), toAppendTo, pos); } else { if (val < 10 * finalK * finalK) return new DecimalFormat("0.0 M").format(val / (finalK * finalK), toAppendTo, pos); else return new DecimalFormat("0 M").format(val / (finalK * finalK), toAppendTo, pos); } } @Override public Object parseObject(String source, @NonNull ParsePosition pos) { return null; } }); Util.d("Redrawing plot"); updatePlot(); } } private void updatePlot() { _ratePlot.calculateMinMaxVals(); double maxY = _ratePlot.getCalculatedMaxY().doubleValue(); _ratePlot.setRangeStep(XYStepMode.INCREMENT_BY_VAL, getRangeStep(maxY, _k)); _ratePlot.redraw(); } private double getRangeStep(double maxY, int k) { if (maxY >= k * k) return getRangeStepForScale(maxY, k * k); else if (maxY >= k) return getRangeStepForScale(maxY, k); else return getRangeStepForScale(maxY, 1); } private double getRangeStepForScale(double maxY, int scale) { if (maxY >= 400 * scale) return 40 * scale; else if (maxY >= 200 * scale) return 20 * scale; else if (maxY >= 100 * scale) return 10 * scale; else if (maxY >= 40 * scale) return 4 * scale; else if (maxY >= 20 * scale) return 2 * scale; else if (maxY >= 10 * scale) return scale; else if (maxY >= 4 * scale) return 0.4 * scale; else if (maxY >= 2 * scale) return 0.2 * scale; else return 0.1 * scale; } } ```

一个局部内部类可以访问非final的外部对象?

``` class Outer1 { int x=100; void method(int a) { int y=4; class Inner { void function() { System.out.println(y); } } new Inner().function(); } } public class InnerDemo2 { public static void main(String[]args) { new Outer1().method(7); } } ``` 看公开课上说,局部内部类只能访问final的变量,为什么我可以,是JDK版本不同的原因吗?还是什么?

关于方法内部类和直接构造getter方法的区别

学习到内部类的时候,看到个例子 class Outer{ private String str = "abc"; public void fun(){ class Inner { public void print(){ System.out.println(Outer.this.str); } } new Inner().print(); } } 请问这么做有什么好处?和直接写一个getter方法的区别是什么? 都是为了输出private的外部类的属性,直接写一个getter方法输出不是更方便吗?

局部内部类 只能访问方法中final类型的变量吗,为什么?

这是书中说的: 局部内部类(Local Inner Class):定义在方法当中,只能访问方法中声明的final类型的变量 但是:我下面的练习发现:它也可以访问非final类型的变量: 这是为什么呢?还是Jdk7版本后新增加的特性? // 3.局部内部类 // 访问权限:可以访问外部内的静态或非静态属性和方法: class LocalInner { public void doSomething() { String b = "1"; final int a = 4; class Inner3 { int c = 1; public void test() { System.out.println(a + b);//b不是final,却可以发访问 } } // 只能在方法块中实例 Inner3 li1 = new Inner3(); li1.test(); System.out.println(li1.c); } }

java方法中定义的局部内部类问题

在方法中定义的内部类为什么只能访问方法中的final类型局部变量? package com.study; interface OutInterface2{ //定义一个接口 } class OuterClass3 { public OutInterface2 doit(final String x){//doit方法参数为final类型 //在doit()方法中定义一个内部类 class InnerClass2 implements OutInterface2{ InnerClass2(String s){ s=x; System.out.println(s); } } return new InnerClass2("doit"); } } 其中s=x是什么意思?最后一句是return new InnerClass("doit"),这个“doit”参数传递给InnerClass的构造方法有意义吗? System.out.println(s)不会输出doit,而会输出X的内容?

Thinking in Java关于学习匿名内部类遇到的问题

// An anonymous inner class that performs initialization. //A briefer version of Parcel5.java. public interface Destination{ String readLabel();} public class Parcel9 { // Argument must be final to use inside anonymous inner class: public Destination destiantion(String dest){ return new Destination(){ private String label = dest; @Override public String readLabel() { return label; } @Override public String toString(){ return label; } }; } public static void main(String[] args) { // TODO Auto-generated method stub Parcel9 p = new Parcel9(); Destination d = p.destiantion("Thinking in Java"); System.out.println(d.toString()); } } 书上说,如果定义一个匿名内部类,并希望它使用一个在其外部定义的对象,那么编译器将会要求其参数是final的,就像你在destination()的参数中看到的那样。如果你忘记了,将会得到一个编译时错误信息。 问题是我删除了final也没看到什么影响

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

立即提问
相关内容推荐