1. __name__=='__main__'是干啥的 先看例子,准备a.py和b.py放在同一个文件夹中 vi a.py # coding: utf-8 print("i am just print") if __name__ == '__main__': print("i am a.py main") vi b.py # coding: utf-8 print("----------------") import a print("
先看一个例子: //class A package com.my.test; class A { static { System.out.println("A1:父类静态代码区域"); } { System.out.println("A2:父类非静态代码区域"); } public A() { System.out.println("A3:父类构造器"); } } //class B package com.my.test; public cla
这篇博客主要是带领大家一起了解整个游戏的执行过程,其中涉及的一些譬如导演,场景,层之类的概念将会在后面讲解. 看main函数的区别: #import <UIKit/UIKit.h> // Under iOS and the Simulator, we can use an alternate Accelerometer interface#import "AccelerometerSimulation.h"//程序入口int main(int argc, char *arg
之前放在自己网站上的例子,因为网站关闭,已经找不到了,想用的时候,没有的话又重新翻书是很麻烦的事情.所以重新记录一下,以备将来查看. 第一种,让任务类继承Runable接口,然后将任务类对象放入Thread对象的构造器,通过Thread.start()方法执行调用. package com.test.thread; public class ThreadTest1 { public static void main(String[] args) { Thread thread = new Thr
Java的Object类 public class Object { public final native void notify(); public final native void notifyAll(); public final native void wait(long timeout) throws InterruptedException; } 调用这些方法的当前线程必须拥有此对象监视器,否则将会报java.lang.IllegalMonitorStateException e