class Song{
String title;
String artist;
String country;
int year;
Song(){
this("title", "artist", "country", 1111); //자신의 다른 생성자 호출
}
Song(String title,String artist ,String country,int year){
this.title = title;
this.artist = artist;
this.country = country;
this.year = year;
}
void show() {
System.out.println(year+"년 "+country+"국적의 "+artist+"가 부른 "+title);
}
}
class Main{
public static void main(String[] args) {
//Song sg = new Song("Dancing Queen","ABBA","스웨덴",1987);
//int arr[] = new int[100];
Song sg[] = new Song[100];
for(int i=0;i<sg.length;i++) {
sg[i] = new Song();
}
sg[0].show();
//sg.show();
}
}
import java.util.*;
class Book{
String title,author;
Book(String title,String author){
this.title = title;
this.author = author;
}
}
public class Main{
public static void main(String[] args) {
Book [] bk = new Book[2];
Scanner sc = new Scanner(System.in);
for(int i = 0;i<bk.length; i++) {
System.out.println("제목>>>>");
String title = sc.nextLine();
System.out.println("저자>>>>>>>>>");
String author = sc.nextLine();
bk[i] = new Book(title, author);
}
for(int i = 0 ; i<bk.length;i++) {
System.out.println("("+bk[i].title +", "+ bk[i].author+")");
}
sc.close();
}
}
import java.util.*;
class Circle {
private double x, y;
private int radius;
Circle(double x, double y, int radius) {
this.x = x;
this.y = y;
this.radius = radius;
}
public int getR() {
return radius;
}
public void show() {
System.out.println("(" + x + "," + y + ")" + radius);
}
}
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Circle c[] = new Circle[3];
for (int i = 0; i < c.length; i++) {
System.out.println("x,y, radius >>>");
double x = sc.nextDouble();
double y = sc.nextDouble();
int radius = sc.nextInt();
c[i] = new Circle(x, y, radius);
}
int max = 0;
for (int i = 0; i < c.length; i++) {
if(c[i].getR()>c[max].getR()) {
max=i;
}
}
System.out.println("가장 넓이가 큰 원은");
c[max].show();
}
}
*/
class Day{
private String work;
public void set(String work) {
this.work = work;
}
public String get() {
return work;
}
public show() {
if(work == null) {
System.out.println("없습니다");
}
else System.out.println(work+"입니다");
}
}
public class Main{
public static void main(String[] args) {
}
}