1。输出unicode码
import java.util.*;
publi class Test_8{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String str=input.nextLine();
char ch=str.charAt(0);
int i=(int)ch;
Sysstem.out.println(i);
}}
2水仙花数
import java.util.Scanner;
public class Main{
public static int pows(int x,int N)
{
int ans =1;
for(int i=0;i<N;i++)
{ans *=x;}
return ans;}
public static void main(String[] args){
Scannner sc=new Scanner(System.in);
int n=sc.nextInt();
int min.max;
min=pows(10,n-1);
max=min*10;
继续,懒得写了
3填空一个
java all类都是Object 的子类
覆盖方法 public String toString()
4.stringbuilder效率比string高
编程题2道
abustract class Animal{
abstrct void cry();
abstract void getAnimaName();}
class Dog extends Aniaml{
void cry(){
Sytem.out.println("ww");}
void getAnimal){
System.out.println("刚刚");}}
class Siu{
void playSound(Animal animal){
animal.cry);
animal.getAniamlName():}
5 学生类大收尾
class Student{
String name;
int age;
Student(String name,int age){
this.name=name;
this.age=age;
}public void show(){
System.out.println("name:"+name+"'+'age"+age);}}
class under extends Student{
String degree;
super(name,age);
this.degree=degree;}
public void show(){
同理
}
public class zzz{
public static void main(Stiring ages[]){
Student student =new Student("zhangsan",19);
under under=new Under("lisi',20,"bechlor");
student.show();
under.show();}}