public class Helloworld
{
public static void main (String[] args)
{HelloWorld hello = new HelloWorld() ;int maxScore = hello. getMaxAge();
System. out. println("最大年齡為: " + maxScore);
public int getMaxAge() {
int[] ages = (18 ,23 ,21 ,19 ,25 ,29 ,17);int max = ages[0];
int len = ages. length;
for(int i = 0;i < len;i++)
{
if(max < ages[i])
max = ages[i];
return max;
}
}
public class HelloWorld
{
public static void main(String[] args) {
int num = 999;int count = 0;
if (num> 0 && num< 1000000000 {
while (num != 0) {
count++;num /= 10;
System. out.println("它是個"+count+"位的數! ");
else
System. out.print1n("輸入有誤! ");
}
}
class Animal {
public void eat() {
System. out. println ("動物具有吃的能力");
}
}
class Dog extends Animal{
public void eat() {
System. out. print1n("狗是吃肉的");
class Cat extends
Animal {
}
class Main {
public static void main(String[] args) {
Animal obj1 = new Animal () ;
Animal obj2 = new Dog();
Animal obj3 = new Cat();
obj1.eat();
obj2.eat();
obj3.eat();
}
}
public class Helloworld
{
public static void main (string[] args)
{int x =3;
for(int i =1; i<= x; i++)
for(intj =1; j<=x-i;j++)
System. out.print(" ");
for(intj =1;j<=2*i-1; j++)
System. out.print ("*");
System . out. println();]
for(int i = x-l; i > 0; i--)
for(intj =1; j <= x-i; j++)
System. out.print(" ");
for(int j=1;j<=2*i-1; j++)
System. out.print ("*");
System. out.println();
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/101990.html
標籤:新技術前沿
上一篇:verliog實作四位電子密碼鎖(fpga AX301板子),會的可以私聊
下一篇:專業介紹
