public class Demo1 { int name2=1; public Demo1(int name) { name=name2; } public Demo1() { } public void Uii() { int b; b= name2+1; System.out.println(b); } 语法: public 和类明一样的名字 可以有多个 变量在类里面都是通用的 调用方法 Demo1 aaa=new Demo1(2); Demo1 aaa=new Demo1(); #调用
#! /usr/bin/env python # -*- coding: utf-8 -*- import Tkinter as tk class FullScreenApp(object): def __init__(self, master, **kwargs): self.root = master # self.tk.attributes('-zoomed', True) # This just maximizes it so we can see the window. It's no