About the Object Class
Why Object is the Base class for the alll the classes in java ?
Is there any specific reason , can any one explain it in detail ?
Hi,
Hmm try to understand OO! OO defines anything in the world to be an object. A description of similar objects is defined as class.
So number should be an class, plane, people, computer.... When anything is an object, all the objects should have some behaviour in common (all Objects can be put to a List, all Objects can be printed to the screen using toString() and so on). So all Classes need to have a baseclass. This Class is called Object in Java (anything is an Object). Well you should know, that not anything is an Object in Java - int, boolean, char, float, double ... are primitives. So Java is not "real" OO - this is done due to performance reasons. When you want to use primitives as Objects, use a Wrapper Class (Boolean, Char...),
Lars.
Similar Messages
-
How to get the object class field value in CDHDR table for vendor
hi
how to get the object class field value in CDHDR table for vendorTry KRED/KRED_N as object class in CDHDR for Vendor.
-
ToString() of the Object class. Guide please
Hiya,
I need to ask a question please.
I havent understood the exact meaning of the toString() defined
in the Object class?
When and where do we need to override this?
How can I use this inherited method and see the output
How can I use this method,now overidden and see the output.
Can some please send in a small code...
Regds"String Representation" doesn't sound like a widget to
me... I haven't tried it, though. Can you provide some
code please, showing how I could use the mechanism you
mentioned?You know.... Widgets!import java.awt.*;
import javax.swing.*;
public class Test3 extends JFrame {
public Test3() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = getContentPane();
MyObject[] myData = {new MyObject("Hello",1),new MyObject("Hi",27)};
JList jl = new JList(myData);
jl.setCellRenderer(new Widget());
content.add(jl, BorderLayout.CENTER);
setSize(300, 300);
setVisible(true);
public static void main(String[] arghs) { new Test3(); }
class Widget extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value,int index,
boolean selected,boolean focus) {
JLabel jl = (JLabel)super.getListCellRendererComponent(list,
value,index,selected,focus);
jl.setText("("+jl.getText()+")");
return jl;
class MyObject extends Object {
String name;
int num;
public MyObject(String name, int num) {
this.name=name;
this.num=num;
public String toString() { return name+"-"+num; }
} -
Explicitly extending the Object class
Hi Everyone,
I am aware that every object that is running inside a JVM inherits from class Object implicitly. Recently I have come across some code that explicitly extends the Object class, is there any advantage in doing this, please see the code snippet below:
public class MyClass extends Object{}Thanks heaps for your assistance.
Regards
DavoI've even seen a
method that was declared "throws NullPointerException"shouldn't it have been "throws java.lang.NullPointerException" ...
- I almost cried. Yes, thats truly a terrible habit :(
a distant cousin of that habit is one I have noticed where the developer
is totally unable to name anything appropriately..
to print some things to the screen: "loadData"
to print things to screen again: "getInformation" *(note: did not 'return' anything).
... :( -
Today! I have a few comments about the objective error iOS 7.0
To contact Apple was difficult, because I have a few comments about the objective error iOS 7.0 operating system.
On iPhone 4s, iPhone 5, this operating system slowly when I touch to apple apps such as notes, compass, telephone, ... very slowly. Also as simple to use application photo of about 4 minutes, iOS 7.0 on iPhone 4s was overheat and battery from 100% use 4 minutes to 96%, so quickly. In the lock screen (not control center) when playing song, I just press forward 1 song very difficult, strong problem. On Safari, I can not adjust the font size in Reader. why have app Facetime on iPhone 4, iPhone 4s?
Hopefully, Apple can continue to fix bugs in iOS 7 for the client and myself. On the iPad 3 and iPad 4 are also many more errors such as freezes, slow to open applications, the iOS app does not fit 7 tablet.To contact Apple was difficult, because I have a few comments about the objective error iOS 7.0 operating system.
On iPhone 4s, iPhone 5, this operating system slowly when I touch to apple apps such as notes, compass, telephone, ... very slowly. Also as simple to use application photo of about 4 minutes, iOS 7.0 on iPhone 4s was overheat and battery from 100% use 4 minutes to 96%, so quickly. In the lock screen (not control center) when playing song, I just press "back" 1 song very difficult, strong problem. On Safari, I can not adjust the font size in Reader. why have app Facetime on iPhone 4, iPhone 4s?
Hopefully, Apple can continue to fix bugs in iOS 7 for the client and myself. On the iPad 3 and iPad 4 are also many more errors such as freezes, slow to open applications, the iOS app does not fit 7 tablet. -
I need some info about the Document Class.
Hi,
I need some information about the Document Class, can anybody
tell me where I can find it.
thanksEmad Zedan,
> I need some information about the Document Class, can
> anybody tell me where I can find it.
The concept of the document class was introduced in Flash
CS3. What it
does is allow you to optionally associate a custom AS3 class
with your FLA
in the Flash authoring tool. Your document class effectively
*becomes* the
main timeline. This is your chance to influence the
underlying behavior of
the MovieClip or Sprite instance that serves as the
foundation for your SWF.
If you don't associate a custom document class with your
FLA, the FLA is
associated automatically with a default document class called
MainTimeline,
which extends MovieClip.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design." -
Information about the ExternalConnection class inFramework.
There has been a lot of email asking about this class lately so here is
the latest on the status of the ExternalConnection class.
Currently the feature is in Beta. However it MAY be productized in 2F.
After a successful period of beta testing for the ExternalConnection
feature, we decided to widen the distribution of it. So we will provide
the example and documentation to any customer that asks for it.
You can get the documentation either from your Forte rep or Technical
Support. The example can also be emailed to you.
There is one outstanding bug in 2E, but it will only occur if you try
and write while reads are still outstanding on the same connection.
Hope this answers some questions.
kathy
Katherine A. Brown
Technical Support Team Manager
Forte Customer Services
=================================
(ph) 510.869.3439
(fax) 510.869.2010
(email) [email protected]
(hotline) 510.451.5400
=================================
From a Chinese fortune cookie: Customers are the precious things
Goods are only grass.
=================================Hi Julien,
The main reason is portability. It's true that in many J2EE implementations it is possible to access an EJB's Home object without going through the component context (java:comp/env), but all such approaches are NOT portable. In the J2EE programming model, all resource access is made via the private component namespace. Using this level of indirection allows the bean developer to code the application without having to know which physical resource will be used at runtime. Each J2EE implementation can use a different scheme to identity physical resources, so by sticking to logical references in your code, you guarantee portability. Finally, you have the advantage that you can change which physical resource is mapped at deployment time without having to change your code.
So, the bottom line is, whenever you have any J2EE component (ejb, servlet, jsp, Application Client) that looks up an ejb, data source, queue, connection factory, etc., always use the environment reference type that J2EE defines for it and look it up via java:comp/env.
--ken
Kenneth Saks
J2EE SDK Team
SUN Microsystems -
When do we override our own clone method not the Object class clone method
Hi,
I have a confusion in overriding clone method.We can create clone object by writing Object.clone() but some times I have seen writing our own clone method ,when do we write this,also clone() is defined protected and when we write our own clone it is said to write it public,why?
Thanks
Sumitprotected methods can only be called in the same class and it subclass. You can make clone protected if this is all you need.
However if you need to clone() the object from another class, it need to be public.
This is the same for any method.
Also as Object.clone() is protected you cannot make it private or package-local (this is true of any protected method) -
Question about the String class
Did I understood the JLS/Javadoc properly if I say that the String class has got an internal pool of String objects (therefore I expect this pool to be stored in some sort of static variable)?
Looking at the intern() method in the String class, this is declared as native, which make me think the whole pooling thing is managed internally by the JVM.
Does this mean that, if there is only a String class per JVM and String literals (or better Strings that are values of constant expressions) are pooled in the String class, the more String constants are around the bigger the String class object becomes?Did I understood the JLS/Javadoc properly if I say
that the String class has got an internal pool of
String objects (therefore I expect this pool to be
stored in some sort of static variable)?Yes.
Looking at the intern() method in the String class,
this is declared as native, which make me think the
whole pooling thing is managed internally by the JVM.The intern() method is implemented in some programming language. If you happen to have a Java runtime where it is written as a native method, it is probably implemented in C or C++. Not a terribly important detail.
Does this mean that, if there is only a String class
per JVM and String literals (or better Strings that
are values of constant expressions) are pooled in the
String class, the more String constants are around
the bigger the String class object becomes?The String.class object (of type java.lang.Class) as such doesn't "grow", but some memory structure somewhere will contain interned String literals. Probably a hash table of some sort. Yes indeed: if you have String literals in your program, those literals are stored in the computer's memory during runtime so that they can be accessed by the executable program code. -
About the Skin class and all the subclasses...
To test and get to know the workflow of catalyst & fb I've started to create a custom video player. Dragging a psd through catalyst work the magic then port it to flex builder.
Everything fine and well after some playing arround in catalyst (nontheless the lack of a togglebutton for now but that's neglectable) I've got it ported to flash builder.
In fb; I am using a spark VideoPlayer instance and skin it with a VideoPlayerSkin. Here arrises the first problem; it seems the VideoPlayer mxml tag doesn't recognizes the mxml file extending VideoPlayerSkin.
Ok I can bypass this using skinClass={CustomVideoSkin} (CustomVideoSkin is the class name of my actual VideoPlayerSkin).
Now when I look at the button skins catalyst exported (which I made in catalyst) I see the usage of the <s:Skin> class where all states are defined and transitions if there are anny. This get's me kinda confused couse it seems there is for each component an individual skin class but using the <s:Skin> compared to ex: <default:VideoPlayerScrubBarSkin> is completely different.
In the case of using the above example (VideoPlayerScrubBarSkin) I need to extend this to VideoPlayerScrubBarSkin this to assign the face and the track.
I'm getting kinda lost in using what and when and where and more how...
Would appreciate some clarification on this.
Regards, BartHey Bart,
I couldn't really tell if you were running into a Catalyst issue or a Flex SDK issue (or both). From the Flex SDK perspective, when you skin any component, you create a new MXML class rooted with <s:Skin> (this really means the new file extends the Skin class).
Here's a short and simple custom skin for the Video Player:
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo">
<!-- states -->
<s:states>
<s:State name="connectionError" stateGroups="connectionErrorStates, normalStates" />
<s:State name="disabled" stateGroups="disabledStates, normalStates"/>
<s:State name="disconnected" stateGroups="disconnectedStates, normalStates"/>
<s:State name="loading" stateGroups="loadingStates, normalStates"/>
<s:State name="playing" stateGroups="playingStates, normalStates"/>
<s:State name="stopped" stateGroups="stoppedStates, normalStates"/>
<s:State name="fullScreenConnectionError" stateGroups="connectionErrorStates, fullScreenStates"/>
<s:State name="fullScreenDisabled" stateGroups="disabledStates, fullScreenStates"/>
<s:State name="fullScreenDisconnected" stateGroups="disconnectedStates, fullScreenStates"/>
<s:State name="fullScreenLoading" stateGroups="loadingStates, fullScreenStates"/>
<s:State name="fullScreenPlaying" stateGroups="playingStates, fullScreenStates"/>
<s:State name="fullScreenStopped" stateGroups="stoppedStates, fullScreenStates"/>
</s:states>
<s:VideoElement id="videoElement" top="0" bottom="24" />
<s:Group height="24" bottom="0">
<s:layout>
<s:HorizontalLayout />
</s:layout>
<s:Button id="playButton" label="Play Me" />
<s:Button id="pauseButton" label="Pause Me" />
<s:VideoPlayerScrubBar id="scrubBar" />
</s:Group>
</s:Skin>
Each component has a skin. By default, VideoPlayerScrubBar uses the default skin we ship with the component. To skin that sub-part, you'll need to create a new Skin file, something, like:
<s:VideoPlayerScrubBar id="scrubBar" skinClass="CustomVideoPlayerScrubBarSkin" />
This new skin file can be done inline (with Declarations), but it's reccomended just to create a new MXML file for it.
Let me know if you've got any more questions about this process.
HTH,
Ryan -
Dear all,
I tried to run 'FDialogPJC.java', that is based on 'FDialog.java', by such command - 'java FDialogPJC', for directly calling its compiled class. But I was not successful.
Here are the errors:
Exception in thread "main" java.lang.NoClassDefFoundError: FDialogPJC (wrong nam
e: pkg2/FDialogPJC)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
And here are the programs:
FDialog.java --->
package pkg;
import java.awt.*;
import java.beans.*;
public class FDialog extends Canvas
private String file_name ;
private PropertyChangeSupport pcs;
public FDialog() {
file_name = "";
pcs = new PropertyChangeSupport(this);
public void set_file_name()
Frame frame = new Frame("Sample");
java.awt.FileDialog OpenDlg = new FileDialog(frame, "Open ", java.awt.FileDialog.LOAD);
OpenDlg.setFile("*.*");
OpenDlg.show();
String old_file_name = file_name;
file_name=OpenDlg.getDirectory() + OpenDlg.getFile();
pcs.firePropertyChange("file_name", old_file_name, file_name);
public void addPropertyChangeListener(PropertyChangeListener pcl)
pcs.addPropertyChangeListener(pcl);
public void removePropertyChangeListener(PropertyChangeListener pcl)
pcs.removePropertyChangeListener(pcl);
FDialogPJC.java --->
package pkg2;
import pkg.FDialog;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import oracle.forms.properties.ID;
import oracle.forms.handler.IHandler;
import oracle.forms.ui.CustomEvent;
import oracle.forms.ui.VBean;
public class FDialogPJC extends VBean
implements PropertyChangeListener{
private Component mComp;
private IHandler mHandler;
private static final ID SHOWFILEDIALOG = ID.registerProperty("showfiledialog");
private static final ID FILENAME = ID.registerProperty("filevalue");
private static final ID FILECHANGEEVENT = ID.registerProperty("filechangeevent");
public FDialogPJC() {
super();
try{
ClassLoader cl = getClass().getClassLoader();
Object obj = Beans.instantiate(cl,"pkg.FDialog");
mComp = (Component)obj;
mComp.setVisible(true);
mComp.setEnabled(true);
((pkg.FDialog)mComp).addPropertyChangeListener(this);
// add the component to this
add("Center",mComp);
catch(Exception e)
{ e.printStackTrace(); }
public void init(IHandler handler)
super.init(handler);
mHandler = handler;
public boolean setProperty(ID pid, Object value)
if(pid ==SHOWFILEDIALOG) {
((pkg.FDialog)mComp).set_file_name();
return true;
else
return super.setProperty(pid,value);
public void propertyChange(PropertyChangeEvent pce)
String new_file_name=(String)pce.getNewValue();
try {
mHandler.setProperty(FILENAME, new_file_name);
} catch(Exception e) {}
CustomEvent ce = new CustomEvent(mHandler, FILECHANGEEVENT );
dispatchCustomEvent(ce);
Thks & Rgds,
EdwardAs FDialogPJC has some calls to FDialog, I just have run it as 'main' class in such way:
java -classpath c:\Dilg pkg2.FDialogPJC
And I've already created the folders - pkg and pkg2 within 'Dilg' and have put the 2 classes there respectively as well.
But I just have got such errors:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/forms/ui/VBean
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) -
"Object" Class was chosen to be the super class of all objects. Why is "Class" class not the chosen superclass of all objects?
Because not everything "is a" class, but everything "is a" Object. That is, an instance of any class would also have to be an instance of Object (you can't have an object that's not an Object), but it doesn't make sense to say that an instance of any class is also an instance of the class Class.
-
Hi all,
I come from a C background and am trying to learn JAVA. I was wondering if the type Object was like a void ptr in C.
example :
Object oref;My C is fairly limited, but from memory a void pointer is just a pointer that is not currently assigned to "point" to anything. This is not the same as an Object type in Java.
Object is the root class for everything in Java. So if you write your own class, it will automatically extend Object (maybe not immediately, but somewhere in the hierachy a Class will extend from Object).
Object provides some useful functionality that all classes therefore have, such as toString() and hashCode()
Normally, when writing Java, you would not decalre something of type Object, as it would usually be some more specific Sub-Class -
At first, I have added a object form of RO1,The permissions for the object form has been set.
Then,when I login to the Administrative Console as UserA and click Request New Resources to request RO1, the step2(Provide Resource Data) is skipped, it is jump to the step3 from step1 directly, that is the object form does not display. Why? Please give me some advice. I do not konw what's wrong.
Thanks!Hi
You cant achieve the above ootb. You can either have the prepops that will work great for both the request and direct provisioning (but the data from the object form will not flow to the process form even though the dataflow mappings have been done(for a request) if prepops are attached to the process form.
I would suggest that if you do want to achieve the requirement that you've specified, you should do the following:
1) Have the data flow mappings done and no prepops on the process form.
1) Make all fields in your process form optional (oim will not allow you to save a process form with blank values for mandatory fields, hence you need to do this)
2) Have a first process task (reqd for completion) in your prov process that checks if certain attributes like userid, password, etc which are required in order to create an account etc are blank or not
3) If they are blank it indicates that provisioning was triggered off through direct provisioning and then in such a circumstance you will get the values for the fields on the process form from the User def for that user using findUsers() and populate the process form using api's and on the success of this task then trigger off the CreateUser (conditional task)
This will work for both request based and direct prov without pre pops. -
Here is the HTML I get when I publish with CS6:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>tooneat_CS6</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #000000;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="2560" height="1160" id="tooneat_CS6" align="middle">
<param name="movie" value="tooneat_CS6.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="false" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="tooneat_CS6.swf" width="2560" height="1160">
<param name="movie" value="tooneat_CS6.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="false" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
And here is the HTML I get when I publish with CC:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>tooneat</title>
<style type="text/css" media="screen">
html, body { height:100%; background-color: #000000;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<div id="flashContent">
<object type="application/x-shockwave-flash" data="tooneat.swf" width="2560" height="1160" id="tooneat" style="float: none; vertical-align:middle">
<param name="movie" value="tooneat.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="false" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</object>
</div>
</body>
</html>
Also why are the DOCTYPE html and html tags different? The HTML published by CC is missing all that jazz about W3C....??Nested object embeds when used with IE conditionals actually have greater compatibility, but we're stretching the mark back to IE5-8:
http://www.bobbyvandersluis.com/flashembed/testsuite/
You can see SWFObject's example communication with callback page utilizes it (view source):
view-source:http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_com2.html
Maybe you are looking for
-
Error Message: The Adobe InContext Editing service is currently unavailable
Hey Folks, For the past week, my client is getting the folowing error message when he tries to log in: The Adobe InContext Editing service is currently unavailable. We are sorry for any inconvenience this may cause you. Please try again later. Howeve
-
How to create multiple items in popup window
Hi, i am using apex3.2. i want to create page as a popup and that popup page has multiple of select list items .i have 8 select list item on popup page.i have a link on other page.when i click on this link popup page should open .after selecting valu
-
Setting viewing options in iTunes 12
How do I set command i pop up window to always show "album artist" and "disc number" ? (I have no idea why Apple thinks it is a good idea to hide other fields when there is so much screen real estate to make the pop up larger. It is annoying that the
-
Reg: Runtime exception occurred during application mapping
Dear SAP Gurus, This is Amar Srinivas Eli working currently on SOAP to SOAP Scenario on PI 7.1 Server. I Would like to inform you that I have done all steps regarding DESIGN and CONFIG and also regarding SERVICE REGISTRY part successfully. While Test
-
Can't export 16 bit tiff in A3.1.3 Lion
If I try to export a 16 bit tiff, the extension automatically changes to jpg. I can only export an 8 bit tiff. Thanks for any tips.