I started to learn Java's notes, now preliminarily, now post it! The second part came

xiaoxiao2021-03-06  61

7.

Class Student

{

Int a;

String B;

Public Student (INT i)

{

}

Public void aa ()

{

System.out.println ("aa");

}

Public String BB ()

{

System.out.println ("bb");

Return "100";

}

Void CC (INT I, STRING J)

{

System.out.println ("cc");

System.out.println (i);

System.out.println (j);

}

INT DD (Int I, String J)

{

System.out.println ("DD");

System.out.println (i);

System.out.println (j);

Return 30;

}

}

8.

Import java.awt. *;

Class test_awt

{

Public static void main (string [] args)

{

Frame fr = new frame ("abcd");

Button B = New Button ("Hello");

Fr.Add (b);

Fr.setsize (300, 300);

Fr.show ();

}

}

9.

Class test_dog

{

/ *

The comments here are not executed, you can put it in a place where you need it!

* /

/ **

The comments here are document comments, must be placed in front of classes, methods, properties, packages, and overview

* /

Public static void main (string [] args)

{

DOG DD = New DOG ();

Dd.a ();

DD.B ();

Dd.color = "while";

DD.WEIGHT = 20;

System.out.println (DD.COLOR);

DD.C ("White");

DD.D (100);

Dd.a ();

DD.B ();

System.out.println ("Hello World!");

DD.AA ();

}

}

转载请注明原文地址:https://www.9cbs.com/read-84423.html

New Post(0)