Last semester of the object-oriented programming class is in C + + language, to Java, the idea should not be much change, but the grammatical part of some changes, here to record (idea blown)
ImportJava.lang.System;Importjava.util.Collections;ImportJava.util.Comparator;ImportJava.util.Scanner;Importjava.util.Arrays;classa{ Public intNUM1; Private intnum2; PublicAintNUM1,intnum2) { This. num1=NUM1; This. num2=num2; } voidCreate () {}}classBextendsa{ PublicBintNUM1,intnum2) { Super(NUM1, num2); } voidCreate () {System.out.println ("I am a subclass"); }} Public classHelloWorld { Public Static voidMain (string[] args) {b b=NewB (); B.create (); }}/*1 7 3 6 3*/
Inheritance: Add extends+ class name after class
Abstract class: A class that contains abstract methods must be declared as abstract classes, whereas abstract classes can have abstract methods, or they can have no
Permission definition: A permission modifier is added before each member
Java Konjac Konjac Learning Path-class learning (partly different from C + +)