Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Aaron S.

Gesmundo January 30, 2022


BSCS-2B

Activity No. 1
1. Create a class, attribute, method and object and create a comment to each section for
identification of code/string.
2. Use method to print out your name, course, subject/program, block and schedule.

INPUT
// I combined the two number, 1 and 2 to create a single program

//A class is created using the class keyword,StudentInformation is the name of a


class
public class StudentInformation {

// I create an attribute name having a different value of my information.


String name = "Name: Aaron Gesmundo";
String course = "Course: Bachelor in Science in Computer Science";
String subject = "Subject: 322";
String program = "Computer Science";
String block = "Block: B";
String schedule = "Schedule: TF 4:00-6:00/7:00";

//main is the method.


public static void main(String[] args) {

// Student class object si is created.


StudentInformation si = new StudentInformation();

//The object si uses si.(attribute name) to retrieve the class's attribute


name and I use println () method to print the statement.
System.out.println(si.name);
System.out.println(si.course);
System.out.println(si.subject);
System.out.println(si.program);
System.out.println(si.block);
System.out.println(si.schedule);

}
}
OUTPUT
Name: Aaron Gesmundo
Course: Bachelor in Science in Computer Science
Subject: 322
Computer Science
Block: B
Schedule: TF 4:00-6:00/7:00

You might also like