Which of this is true about class and object?
(a) A class is made of objects
(b) A class is a collection of objects
(c) A class supplies or delivers objects to the rest of the application
(d) A class is used as a template to create objects
(e) An object inherits its variables and their values from its class
(f) An object inherits its variables and methods from its class
(g) An object inherits its variables and methods from its class and its superclasses
(h) The variables and methods of a class are defined in its objects
(i) The variables and methods of an object are defined in its class
(j) The variables, variable values and methods of an object are given in its class
(a) A class is made of objects - true
(b) A class is a collection of objects - true
(c) A class supplies or delivers objects to the rest of the application - true
(d) A class is used as a template to create objects - true
(e) An object inherits its variables and their values from its class - false
(f) An object inherits its variables and methods from its class - true
A class is a not collection of objects. A class not only contains objects
A class represents objects and others.
Similar Messages
-
Which two statements are true about WHERE and HAVING clause ?
Which two statements are true about WHERE and HAVING clause ?
1. WHERE clause can be used to restict rows only
2.HAVING clause can be used to restrict groups only
3.HAVING clause can be used to restrict groups and rows
Plz help me in dis ques...which two will be correct...i think its 1 and 2...but not sure.863180 wrote:
Plz help me in dis ques...which two will be correct...i think its 1 and 2...but not sure.If you are not sure then you do not fully understand HAVING.
SY. -
I don't know what's wrong with my code. it's about class and object.
* This is generic type of Person
package myManagement;
* @author roadorange
public class Person {
private String SS;
private String firstName;
private String lastName;
private String middleName;
private String phoneNumber;
private String address;
private String birthDay;
public void setSS (String SS) {
this.SS = SS;
public String getSS() {
return SS;
public void setFirstName (String firstName) {
this.firstName = firstName;
public String getFirstName() {
return firstName;
public void setLastName (String lastName) {
this.lastName = lastName;
public String getLastName() {
return firstName;
public void setMiddleName (String middleName) {
this.middleName = middleName;
public String getMiddleName() {
return middleName;
public void setPhoneNumber (String phoneNumber) {
this.phoneNumber = phoneNumber;
public String getPhoneNumber() {
return phoneNumber;
public void setAddress (String address) {
this.address = address;
public String getAddress() {
return address;
public void setBirthDay (String birthDay) {
this.birthDay = birthDay;
public String getBirthDay() {
return birthDay;
public void Person() {
SS = "1234567890";
this.firstName = "abc"; //test the keyword "this"
this.lastName = "xyz";
middleName = "na";
phoneNumber = "123456789";
address = "11-11 22st dreamcity ny 11111";
birthDay = "11-11-1980";
public void print() {
System.out.println("Display Database\n"
+ "Social Security Number: *********" + "\n"
+ "First Name: " + getFirstName() + "\n"
+ "Middle Name: " + getMiddleName() + "\n"
+ "Last Name: " + getLastName() + "\n"
+ "Phone Number: " + getPhoneNumber() + "\n"
+ "Address: " + getAddress() + "\n"
+ "getBirthDay: " + getBirthDay() );
package myManagement;
//this class is used to test other class or test other object
public class testClass extends Person{
public static void main(String[] args) {
Person obj1 = new Person();
obj1.print();
System.out.println(obj1.getFirstName()); //test the object
Result:
Display Database
Social Security Number: *********
First Name: null
Middle Name: null
Last Name: null
Phone Number: null
Address: null
getBirthDay: null
null
i don't know why it's all null. i assign something in the default constructor. it shouldn't be "null".
does anyone know why?when you create 2 class using netbean editor, person.java and test.java
i never compile person.java.
when i finish typing these 2 class and i just right click test.java and run.
my question is do i need to compile person.java before i run test.java directly??
does Netbean compile it automatically when i run test.java first time?
i add another constructor Person constuctor with one parameter in Person.java and create 2nd object to test the 2nd constuctor and run.
All the codes work, so does the first default constructor. i don't why is that.
Then i removed what i added and restore back to where it didn't work before and test again. it works.
@_@. so weird.
problem solved. thank you
Edited by: roadorange on Feb 25, 2008 7:43 PM -
Find Universe, classes and objects used in each report
I want to find a list of universes, classes and objects used in each report
or the other way to find list of reports which use a particular universe. please let know, i could not get much information from activity universe in a proper way.Hello Venkataramat,
plese post in more detail what kind of report you are using Crystal report ? webi ? Deski.
Please post in the specific forums.
If you have a Crystal Report I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
Best regards
Falk -
ALV using ABAP Classes and Objects
Hi All,
I am trying to print the values in my internal table using ALV, using ABAP classes and objects. Here the title for columns are picked based on the title specified in the data element. I want to set the title of my columns by my own. how to achieve this ?. Please provide me a sample code if possible.
thanks & regards,
Navneeth.KHello Navneeth
The following sample report shows how to build and modify a fieldcatalog (routine <b>BUILD_FIELDCATALOG_KNB1</b>).
*& Report ZUS_SDN_ALVGRID_EVENTS
REPORT zus_sdn_alvgrid_events.
DATA:
gd_okcode TYPE ui_func,
gt_fcat TYPE lvc_t_fcat,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid1 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1.
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '2000' OBLIGATORY.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
* define local data
DATA:
ls_knb1 TYPE knb1,
ls_col_id TYPE lvc_s_col.
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CASE e_column_id-fieldname.
WHEN 'KUNNR'.
SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
WHEN 'ERNAM'.
* SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
* NOTE: no parameter id available, yet simply show the priciple
CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
WHEN OTHERS.
* do nothing
ENDCASE.
* Set active cell to field BUKRS otherwise the focus is still on
* field KUNNR which will always raise event HOTSPOT_CLICK
ls_col_id-fieldname = 'BUKRS'.
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
is_row_id = e_row_id
is_column_id = ls_col_id.
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = p_bukrs.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create ALV grid
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_docking
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid1.
* Build fieldcatalog and set hotspot for field KUNNR
PERFORM build_fieldcatalog_knb1.
* Display data
CALL METHOD go_grid1->set_table_for_first_display
CHANGING
it_outtab = gt_knb1
it_fieldcatalog = gt_fcat
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* ok-code field = GD_OKCODE
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_FIELDCATALOG_KNB1
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog_knb1 .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'KNB1'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_fcat INTO ls_fcat
WHERE ( fieldname = 'KUNNR' OR
fieldname = 'ERNAM' ).
ls_fcat-hotspot = abap_true.
ls_fcat-scrtext_s = '<short text>'. " short text of column
ls_fcat-scrtext_m = '<medium text>'. " medium text of column
ls_fcat-scrtext_l = '<long text>'. " longtext text of column
ls_fcat-tooltip = '...'. " ALV control: Tool tip for column header
ls_fcat-coltext = '...'. " ALV control: Column heading
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG_KNB1
Regards
Uwe -
Need help w/ created classes and objects
I am having a difficult time understanding what is wrong w/ my classes and objects. I've looked in two books and have messed around a bit. Here is what I am -attempting- to do.
I want to make a class called CLOTHING. In this class i want objects such as shirt and pants (for now).
these are the errors im getting:
.\Shirt.java:6: invalid method declaration; return type required
public Shirt(int size){
^
.\Shirt.java:3: class Clothing is public, should be declared in a file named Clothing.java
public class Clothing {
^
MyClassHW.java:10: cannot resolve symbol
symbol : constructor Shirt (int,int)
location: class Shirt
myShirt = new Shirt(1,1);
^
3 errors------------------------------------------------------------
This is the code for my Clothing class:
import java.awt.*;
public class Clothing {
private int shirtSize;
private void Shirt(Graphics s, int h, int v){
Polygon shirts;
shirts = new Polygon();
shirts.addPoint(5+h,8+v); // 1
shirts.addPoint(17+h,12+v); // 2
shirts.addPoint(19+h,13+v); // 3
shirts.addPoint(33+h,8+v); // 4
shirts.addPoint(37+h,13+v); // 5
shirts.addPoint(25+h,20+v); // 6
shirts.addPoint(25+h,28+v); // 7
shirts.addPoint(15+h,28+v); // 8
shirts.addPoint(15+h,20+v); // 9
shirts.addPoint(1+h,12+v); //10
s.fillPolygon(shirts);
}from what i understand each object is essentially a method...
Here is the code for the java applet I'm making:
import java.awt.event.*;
import java.awt.*;
import java.applet.*;
public class MyClassHW extends Applet { // implements ActionListener, AdjustmentListener {
Shirt myShirt;
int size;
public void init(){
myShirt = new Shirt(1,1);
// <applet code = "MyClassHW.class" height = 300 width=300> </applet>thank you for your time and help. as always, your efforts are appriciated..\Shirt.java:6: invalid method declaration; return type required public Shirt(int size){
I guess, public Shirt(int size) is constructor in class shirt. You have one int in this constructor. Shirt(int size)
Here you initialize your shirt with two int:
MyClassHW.java:10: cannot resolve symbolsymbol : constructor Shirt (int,int)location: class Shirt myShirt = new Shirt(1,1);
Shirt(int size, int what?)
It's why it show such message.
But even if you fix it seems like you have very vague ideas about what you are doing.
As far as I understood you need three classes.
First applet Clothing:
public class Clothing extends Applet{
Shirt myShirt;
Pants myPants;
public void init() {
myShirt = new Shirt(1); // small shirt
myPants = new Pants(32, 40); // medium waist and long legs
Second and third your classes Shirt and Pants:
public class Shirt extends Object {
int size;
public Shirt(int s) {
size = s;
public int getSize () {
return size;
same for Pants, only you need two parameters for it or whatever you want.
You could design it diffrently if you want derive your Shirts and Pants from Clothing and then to use them in your applet. But, indeeed, you desperately have to do some serious reading, where authors are accurate in they definitions and stuff, because it's kind of complicated. -
Class and Object name change in the universe designer
Hello Experts
I have a confusion , I am just wondering if I devlop a bobj universe, lets say, based on SQL database and change the name of the class and object during the creation of the universe, will that fetch the data from d/base properly while running a query / report. Although universe class and object has different names than database now but the records are the same. Do we need to point the object to d/base object in some kind of different or special way .
To make my question more simple, In d/base table name is "Employee" whereas on universe side I create a class name "Staff" and at the same time field name in the database is "Emploee ID" whereas in the universe I named it "Badge number".
Please advise if that will make any difference while I run the query or Is there any kind of complication on the universe side that I should expect which I am not familiar with.
I would apprecite your response.
Best RegardsHello experts,
Let me rephrase the issue with exact scenario.
I have a table names "REGION" with fields region id, region and country id.
I have another table name REGION_SLINE with fields SL_id, region id and Sales_revenue.
I created an equi join between these two tables based on region id field and checked the cardinality which is ok.
Now when I try to create a report based on sales revenue per customer ( "customer's first name" is an other field on CUSTOMER table), I dont get any result in the report and get a message that "No data to reterive"
Also please note that when I run a report which is sales revenue per region id, I get the result, seem slike these two tables REGION and REGION_SLINE can generate the report but sales revenue per customer report is not generated because customer first name is a field of another table.
I was just wondering if I need to write some kind of where clause in the object properties of region id which is used to create equi joon link.
I woulld appreciate your response.
Regards
Edited by: SAP_LCCHS on Jul 4, 2011 9:19 AM
Edited by: SAP_LCCHS on Jul 4, 2011 9:21 AM -
Object Class and Object Id for material Determination tables.
I want to know what is the Object Class and Object Id for material Determination records to verify tables CDHDR and CDPOS.
The purpose is to know the changes done by the different users for material determination records.
Can any one help.Hi ZZZSUNNY,
Similar question is answered recently.Please find the below link which will helps you
Material determination: how to see the creater of a record?
Thanks
Dasaradha -
Docs about RowSet, and Object RowSet questions?
Docs about RowSet, and Object RowSet questions?
I can find RowSet forum, so I ask here!
Can you give me URLs where I can find more about RowSet and URLs for any RowSet implementation?
Does Borlans, Oracle, IBM, etc., have RowSet implementation?
I find out about Sun's RowSet implementation, but I can't find Object Rowset in this implementation?
Is it possible to develop Object RowSet and is it useful?
I know about O/R tools like Hibernate, but Object RowSet can be useful?
Run SQL query and get Objects, or maybe even run Object query (like EJB or Hibernate or JDO have) and get Objects.
No XML mapping mess and simmilar, like with EJB or Hibernate or JDO?You can try
http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
This is a tutorail for RowSet -
Help with Xcode what is the difference between a Function, class and object
Hi all,
I'm new here and in programming in Xcode. My question is can somebody tell me what the difference is between functions classes and object. I will appreciate it if you can involve some articels or something else.
Many thanks,
RL6001Do a Google search for object-oriented programming. When I did, I found the following tutorial, which explains what objects and classes are:
Object Oriented Programming Tutorial -
MAT error: 0xHEX is used a class and object...
Hi there,
playing around some more with MAT I ran into the following error with some of my dumps. All were taken on 1.5 SUN JVMs (running on either Solaris or Linux).
org.eclipse.mat.snapshot.SnapshotException: Error: 0x8d776450 is used as class and object simultaneously. Are you using a beta DLL for Sun JDK 1.4.2 to write the heap dump?
at org.eclipse.mat.hprof.HprofParserHandlerImpl.createRequiredFakeClasses(HprofParserHandlerImpl.java:191)
at org.eclipse.mat.hprof.HprofParserHandlerImpl.beforePass2(HprofParserHandlerImpl.java:89)
at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:76)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:183)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:101)
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:77)
at org.eclipse.mat.ui.internal.ParseHeapDumpJob.run(ParseHeapDumpJob.java:52)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Since the suggested problem (usage of JDK 1.4.2) is not the case: What else can I do to find out what is going on? Do I need any special switches for jmap? The dumps all were taken with the same command:
jmap -heap:format=b <pid>
Still, some work, some do not. Any suggestions?
bye, MichaelHi Michael,
this smells like a bug. The easiest way again is to have a look at the dump. If you zip it, it should become smaller. I could also provide upload space. Right now, I am at the J1 in San Francisco so it might not be as easy for me to fix this.
Andreas. -
Can I use classes and objects to create my own package in LabVIEW?
Hi....I am writing my thesis on develpoing a simulation package. I am trying to compare simulation packages and their feautures as a scope of my project. Does anyone know if LabVIEW allows users to create their own toolboxes like MATLAB?...i mean something that can be done in object-oriented programming by making classes and objects.
thanks guysThe short answer is yes. NI sells toolkits. There's also OpenG. How you code the guts is up to you - you can do it non-LVOOP or LVOOP.
-
What is the difference between acquiring lock on a CLASS and OBJECT (instance) of that class
What is the difference between acquiring lock on a CLASS and OBJECT (instance) of that class
The Java Tutotials has several trails that discuss both implicit and explicit locking, how they work and has code examples.
The Concurrency trail has the links to the other sections you need to review
http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html
The Synchronized Methods and Intrinsic Locks and Synchronization trails discusse Synchronized Methods and Statements
http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html
And the Lock Objects trail begins the coverage of explicit locking techniques.
http://docs.oracle.com/javase/tutorial/essential/concurrency/newlocks.html -
hi every one,
i want use class with object in data block and i want know how i can use inheritance with objects.
becouse i have interview in this two subjects, can any body support my.
thanks,,,,,,,Hello,
Start Forms Builder, the press F1 to display the online help.
In the search tab, you can type "Class Property" or "Object Library" to find documentation on those topics:
About Property Classes A property class is a named object that contains a list of properties and their settings. Once you create a property class you can base other objects on it. An object based on a property class can inherit the setting of any property in the class that makes sense for that object. Property class inheritance is an instance of subclassing. Conceptually, you can consider a property class as a universal subclassing parent. There can be any number of properties in a property class, and the properties in a class can apply to different types of objects. For example, a property class might contain some properties that are common to all types of items, some that apply only to text items, and some that apply only to check boxes. When you base an object on a property class, you have complete control over which properties the object should inherit from the class, and which should be overridden locally. Property classes are separate objects, and, as such, can be copied between modules as needed. Perhaps more importantly, property classes can be subclassed in any number of modules.
or
Using the Object Library These topics contain information about using the Object Library in Oracle Forms: About the Object Library Removing an Object from the Object Library Creating a tab in the Object Library Deleting a Tab in the Object Library Saving an Object in the Object Library Opening an Object Library Module Displaying the Object Library Closing the Object Library Commenting Objects in the Object Library
Francois -
Which Table, can I find the class and characteristic assigned to equipment.
Hi all,
I have assigned a characteristc to a class.
And assigned this class to an equipment.
Now in which table can i find the class assigned to this equipment.
What is the logic to find the class and characteristic.
Thanks in advance.
PiyushHi,
As per above post, you can find classes. To find characteristics, Give EQUNR value in OBJEK field in AUSP table & get the ATINN value.
Give ATINN value in ATINN field in CABN table & get ATNAM field value.
In AUSP table, you can get the values against each characteristics as well.
Regards,
Maheswaran.
Edited by: Maheswaran.K on Apr 19, 2011 9:28 AM
Maybe you are looking for
-
Can a docking speaker be used with IPod nano 7th generation
Can a docking speaker be used with IPod nano 7th generation
-
Problem with the table that goes on next page
Hi all, In my template there is a table that stores detail information. The table property is set to display in box format meaning only the border and not grid. Also I have used <?if:position() mod 10 =0?><xsl:attribute name="break-before">page</xsl:
-
Having trouble downloading 7.1 to itouch
I start to download 7.1 and half way through I get an error that my connection has been lost or something. 9002 I do not loose the connection it just decides to drop. Is there an rss feed that I can get 7.1 from?
-
RH9 FlashHelp Related Topic popup menu behavior
Hi. Recently upgraded to RH9 from RH7. Output is FlashHelp. Use IE7. Discovered that when clicking on Related Topics button, page scrolls up and popup menu appears at the top of the topic, rather than appearing next to the button as it used to. Is th
-
NQServer Error OBIPresentation service cannot started.
Hi All, OBIPresentation service can not started. I have a error message as below at NQServer log file; [2013-04-23T23:12:59.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 004qknFXoTF5uX^5xVH7iW0002z4000001] [tid: 44d7f940] Error Message