/*
class Circle{
int radius; //반지름
String name; //이름
//생성자
Circle ()
{
radius = 100;
name = "몰라요";
}
Circle(int r)
{
this();
radius = r;
}
Circle(int r, String n)
{
radius = r;
name = n;
}
public double getArea() { // 원 넓이 구해주는 메소드
return 3.14*radius*radius;
}
}
public class Main {
public static void main(String[] args) {
Circle pizza = new Circle();
System.out.println(pizza.radius + ", "+pizza.name);
pizza.radius=95;
pizza.name="doyun";
System.out.println(pizza.radius + ", "+pizza.name);
Circle clock = new Circle(2,"doyun");
System.out.println(clock.radius + ", "+clock.name);
Circle donut = new Circle(18,"techer");
System.out.println(donut.radius + ", "+donut.name);
Circle jordy = new Circle(26);
System.out.println(jordy.radius + ","+jordy.name);
}
}*//*
import java.util.*;
class Book {
String title;
String author;
public Book()
{
this("","");
System.out.println("1번 생성자 호출됨");
}
public Book(String title) {
this.title = title;
author = "작자미상";
System.out.println("2번 생성자 호출됨");
}
public Book(String title,String author) {
this.title = title;
this.author = author;
System.out.println("3번 생성자 호출됨");
}
}
public class Main {
public static void main(String[] args) {
Book littleprince = new Book("어린왕자","생텍쥐페리");
Book loveStory = new Book("춘향전");
Book thriler = new Book();
//System.out.println(littleprince.title + " " + littleprince.author);
//System.out.println(loveStory.title + " " + loveStory.author);
}
}*//*
class Main{
int id;
public Main() {
this(0);
System.out.println("생성자 호출");
}
public Main(int x) {
this.id = x;
}
}
/*
class ConstructorExample{
int x;
public void setX(int x) {this.x = x; }
public int getX() { return x; }
public ConstructorExample()
{
}
public ConstructorExample(int x) {
this.x = x;
}
}
class Main{
public static void main(String[] args) {
ConstructorExample a = new ConstructorExample();
int n = a.getX();
}
}
class TV{
int year;
String name;
int inch;
public void show() {
System.out.println(name+"에서 만든 "+year+"년형"+inch+"인치 TV" );
}
public TV()
{
}
public TV(String name,int year,int inch)
{
this.name=name;
this.inch=inch;
this.year=year;
}
}
class Main{
public static void main(String[] args) {
TV myTV = new TV("LG",2017, 32);
myTV.show();
}
}
import java.util.*;
class Grade{
int math;
int science;
int english;
public int average() {
return (math+science+english)/3;
}
public Grade(int math,int science,int english)
{
this.math=math;
this.english=english;
this.science=science;
}
}
class Song{
String tittle;
String artist;
int year;
String country;
public Song() {}
public Song(String tittle,String artist,int year,String country) {
this.tittle=tittle;
this.artist=artist;
this.year=year;
this.country=country;
}
public void show() {
System.out.println(year + "년 " + country + "국적 의 " + artist + "가 부른" + tittle);
}
}
class Main {
public static void main(String[] args) {
//Song mySong = new Song("Dansing Queen","ABBA",1978,"스웨덴");
//Song mySong;
//mySong = new Song("Dansing Queen","ABBA",1978,"스웨덴");
//int [] array = new int[5]; // int 정수를 저장하는 변수가 5개 생성
Song[] mysong = new Song[5]; // Song 클래스 레퍼런스 변수 5개 생성 mysong[0] ~ mysong[4]
for(int i=0;i<5;i++)
mysong[i]=new Song();
//Song mySong = new Song("Dansing Queen","ABBA",1978,"스웨덴");
// Song mySong1 = new Song("Dansing Queen","ABBA",1978,"스웨덴");
// Song mySong2 = new Song("Dansing Queen","ABBA",1978,"스웨덴");
// Song mySong3 = new Song("Dansing Queen","ABBA",1978,"스웨덴");
//mySong.show();
}
}
// 2022 02 24 객체 배열 만들기
class Circle {
int radius;
public Circle(int radius) {
this.radius = radius;
}
public double getArea() {
return 3.14*radius*radius;
}
}
//length 길이 c.length c의 길이
public class Main{
public static void main(String[] args) {
Circle [] c = new Circle[5];
for(int i=0;i<c.length;i++)
c[i] = new Circle(i);
for(int i=0;i<c.length;i++)
System.out.print((int)(c[i].getArea()) + " ");
}
}
*/
import java.util.*;
class Book{
String tittle, auther;
public Book(String tittle, String auther) {
this.tittle = tittle;
this.auther = auther;
}
}
public class Main{
public static void main(String[] args) {
Book [] book = new Book[2];
Scanner scanner = new Scanner(System.in);
for(int i=0;i<book.length;i++) {
}
}
}