Java练习题4_3_2407林大锐格平台

import java.util.Scanner;
class Rectangular {
    private static int x, y;
    private static int countP = 0;

    public Rectangular(int xx, int yy) {
		 x=xx;
		 y=yy;

	}

	public Rectangular(Rectangular p) {
		x=p.x;
		y=p.y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public static void GetC() {
		countP++;
		System.out.println("Object id=" + countP+" X*Y = "+ (x*y));
	}

}

public class Main {
	public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	Rectangular A=new Rectangular(sc.nextInt(),sc.nextInt());
	A.GetC();
	Rectangular B=new Rectangular(A);
	B.GetC();
	}
}
时间: 2024-10-19 00:46:19

Java练习题4_3_2407林大锐格平台的相关文章

Java练习题4_last_1042林大锐格平台

import java.util.Scanner; public class Main{ public static void main(String args[]){ int ri , repeat; int n; Scanner in = new Scanner(System.in); repeat = in.nextInt(); for(ri = 1 ; ri <= repeat ; ri++){ n=in.nextInt(); dectobin(n); } } static void d

Java练习题4_last-1_1043林大锐格平台

import java.util.Scanner; public class Main{ public static void main(String[] args){ int m , n; Scanner in = new Scanner(System.in); m = in.nextInt(); n = in.nextInt(); System.out.println(Min(m,n)); } static int Min(int a,int b){ if(a<=b)return a; el

Java实验题3_8_林大锐格平台

import java.util.Scanner; class Employee { private String name;// 职员名称 public Employee() { }; public Employee(String s) {// 构造函数,初始化职员名称 this.name = s; } public String GetName() { // 获取职员名称 return name; } } class Manager extends Employee{ String depa

Java实验题3_7_林大锐格平台

import java.util.Scanner; abstract class Vehicle { String wheels; abstract String noOfWheels(String a); void showWheels(){ System.out.println(wheels+" wheel vehicle"); } //write your own codes } class Car extends Vehicle { public String noOfWhee

Java实验题3_3_林大锐格平台

import java.util.Scanner; abstract class Shape{ abstract float GetArea(); abstract float GetPerimeter(); } class Rectangle{ private double x,y; public Rectangle(int i, int j) { x=i; y=j; } public float GetArea(){ return (float)(x*y); } public float G

Java实验题3_4_林大锐格平台

import java.util.Scanner; abstract class Animal { public String name; public int age; public float weight; public void showInfo() { System.out.println("name:" + this.name + " age:" + this.age + " weight:" + this.weight); } pu

Java实验题3_5_林大锐格平台

import java.util.Scanner; //write code here class Dog{ String breed,color;int weight; } class SpottedDog extends Dog{ private String spotColor; SpottedDog(String a,int b,String c,String d){ breed=a;weight=b;color=c;spotColor=d; } void showBreed(){ Sy

Java实验题3_1_林大锐格平台

import java.util.Scanner; interface ShowMessage{ void showTradeMark(); } class TV implements ShowMessage{ String a; TV(String a) { this.a=a; } public void showTradeMark() { System.out.println("I am TV "+a); } } public class Main{ public static v

大数据技术之_18_大数据离线平台_02_Nginx+Mysql+数据收集+Web 工程 JS/JAVA SDK 讲解+Flume 故障后-如何手动上传 Nginx 日志文件至 HDFS 上

十一.Nginx11.1.介绍11.2.常见其他 Web 服务器11.3.版本11.4.Nginx 安装11.5.目录结构11.6.操作命令十二.Mysql12.1.介绍12.2.关系型数据库(SQL)种类12.3.特征12.4.术语12.4.与非关系型数据库比较(Not Only SQL)12.4.1.种类12.4.2.特征12.4.3.总结十三.数据收集13.1.收集方式13.2.数据的事件类型13.2.1.Launch 事件13.2.2.PageView 事件13.3.Nginx 日志收集