Skip to main content

creating object invoking various methods

Define a class named College as described below: 

Data Members: 1) collegeName
2) principalName
3) place

Methods : 1) constructor.
2) display() to display the collegeName, principalName, and the place.

Test this class by creating an object and then invoking the various methods.




class collegeName{ 
public String collegeName; 
public String PrincipalName; 
public String place; 
public collegeName(){ 
public void display(){ 
System.out.println("College name is "+this.collegeName); 
System.out.println("Principal name is "+this.PrincipalName); 
System.out.println("Place is "+this.place); 
class displayName{ 
public static void main(String[] args) { 
collegeName c = new collegeName(); 
c.collegeName="Siliguri Institute of Technology"; 
c.PrincipalName="Dr. Mithun Chakraborty"; 
c.place="Siliguri"; 
c.display(); 
}


OUTPUT:

College name is Siliguri Institute of Technology
Principal name is Dr. Mithun Chakraborty
Place is Siliguri


Comments

Popular posts from this blog

Book Photography Tips

বইছবি সুন্দর করার জন্য কয়েকটি পরামর্শঃ ১। প্রথম তো দিনের আলোতে বইয়ের ছবি তুলুন। গুমোট অন্ধকারে তোলা ছবির লুক ভালো আসে না। রাতে লাইটের আলোতে তোলা ছবির লুকও যথেষ্ট ভালো আসে না। ২। যে বইটার ছবি তুলবেন, শুধুমাত্র ঐ বইটার দিকে ক্যামেরার ফোকাস রাখুন। ডেকোরেশনের জন্য অন্য বই সাথে রাখতে পারেন, কিন্তু ঐসকল বইয়ের নাম যেন দেখা না যায়। ঐসকল বইয়ের পেছনের মলাট খোলা রেখে ছবি তুলুন। একটা বই উল্টো করে অন্য বইটা ঢেকে দিন। ৩। বইয়ের বেকগ্রাউন্ডে পুরোপুরি সাদা বা এক কালারের রঙিন কাপড় বিছিয়ে ছবি তুলুন। ছবির সৌন্দর্য অনেকগুণ বাড়বে। ৪। পারতপক্ষে বইয়ের সাথে দু-একটি বুকমার্ক রাখুন। ছবি মানানসই দেখাবে। ৫। সৌন্দর্য বৃদ্ধির জন্য প্রয়োজনীয় উপকরণ যেমন:  চায়ের কাপ, মগ, কালার পেপার, ফুল, রঙিন পাতা, ইত্যাদি আনুষঙ্গিক জিনিসপত্র সাথে রেখে ডেকোরেশন করে এরপর বইয়ের ছবি তুলুন। আগের চেয়ে বেটার আসবে ছবি। ৬। ছবি তোলার আগে উপকরণগুলো বিভিন্ন পজিশনে সাজিয়ে নিন। কোনো উপকরণ দুটোর বেশি রাখবেন না। হিজিবিজি দেখাবে। আবার অনেকগুলো উপকরণ সাথে রেখে ছবি তুলতে যাবেন না। বেমানান লাগবে। ৭। বইয়ের বিষয়বস্তুর সাথে খাপ খায় এমন শব্দ, বাক্য সাদা...

Indexing in DBMS

Indexing in DBMS Indexing is used to optimize the performance of a database by minimizing the number of disk accesses required when a query is processed.  The index is a type of data structure. It is used to locate and access the data in a database table quickly. Index structure: Indexes can be created using some database columns. The first column of the database is the search key that contains a copy of the primary key or candidate key of the table. The values of the primary key are stored in sorted order so that the corresponding data can be accessed easily.  The second column of the database is the data reference. It contains a set of pointers holding the address of the disk block where the value of the particular key can be found. Indexing Methods Ordered indices The indices are usually sorted to make searching faster. The indices which are sorted are known as ordered indices. Example: Suppose we have an employee table with thousands of record and each of which is 10 byte...

List vs Tuple

List vs Tuple (Image by - Sharma Guides | Subham232330) List | |- Syntax :- [2,3,4] | |- Mutable :- Elements can be changed after creation. | |- Length :- Variable length. | |- Memory :- List takes more memory than a tuple. Tuple | |- Syntax :- (2,3,4) | |- Immutable :- Elements cannot be changed after creation. | |- Length :- Fixed length. | |- Memory :- It takes less memory than a list.