1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <meta name="author" content="kjell at ieee dot org "> <meta name="copyright" content="2011"> <meta name="robots" content="index,follow"> <title>Picture of an Object</title> <link rel="stylesheet" type="text/css" href="../CAIstyleRev2.css"> </head> <body> <!-- generated by CSSmaker.java, version 07/24/2010 on Sat Feb 12 16:31:35 EST 2011 --> <!-- ANSWER DIVISION --> <div class="answer"> <div class="topnavigation"> <a href="ch25_5.html"><img src="../backIcon.gif" alt="go to previous page"></a> <a href="../../index.html#25"><img src="../homeIcon.gif" alt="go to home page"></a> <a href="Audio/chap25-06.mp3" target="audioPlayer" type="audio/mpeg"><img src="../audioIcon.gif" alt="hear noise"></a> <a href="ch25_7.html"><img src="../nextIcon.gif" alt="go to next page"></a> </div> <h3>Answer:</h3> <p> A <em>von Neumann computer</em> uses general purpose memory to store both programs and data. </p> <br class="clearfloats"> </div> <!-- LESSON DIVISION --> <div class="lesson"> <h1>Picture of an Object</h1> <a name="von Neumann"></a> <img src="objectPicture.gif" class="rightimage" alt="object as memory"> <div class="left"> <p> In terms of object-oriented programming, a <b>von Neumann computer</b> uses general purpose memory to store both the state and behavior of objects. It is interesting that an idea from the 1940's is still important. </p> <p> A software object consists of both variables (state information) and methods (recipes for behavior). In the picture, the yellow bricks represent bytes of memory out of which the object is built. This object has some variables, <code>location</code>, <code>color</code>, and <code>size</code>, and has some methods that control its behavior. </p> <p> In object-oriented programming, the programmer uses a programming language (such as Java) to describe various objects. When the program is run (after being compiled) the objects are created (out of main storage) and they start "doing things" by running their methods. </p> <p> The methods must execute in the correct order. For an application, the first method to run is the method named <code>main()</code>. There should be only one method named <code>main()</code> in an application. In a small application, <code>main()</code> might do by itself all the computation that needs to be done. In a larger application, <code>main()</code> will create objects and use their methods. </p> </div> <br class="clearfloats"> </div> <!-- QUESTION DIVISION --> <div class="question"> <h3> QUESTION 6:</h3> <p> Have you seen a <code>main()</code> method before? </p> <div class="navigation"> <a href="ch25_5.html"><img src="../backIcon.gif" alt="go to previous page"></a> <a href="../../index.html#25"><img src="../homeIcon.gif" alt="go to home page"></a> <a href="ch25_7.html"><img src="../nextIcon.gif" alt="go to next page"></a> </div> </div> </body> </html> |
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCIgPgo8aHRtbD4KPGhlYWQ+CjxtZXRhICBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDtjaGFyc2V0PWlzby04ODU5LTEiPgo8bWV0YSBuYW1lPSJhdXRob3IiIGNvbnRlbnQ9ImtqZWxsIGF0IGllZWUgZG90IG9yZyAiPgo8bWV0YSBuYW1lPSJjb3B5cmlnaHQiIGNvbnRlbnQ9IjIwMTEiPgo8bWV0YSBuYW1lPSJyb2JvdHMiIGNvbnRlbnQ9ImluZGV4LGZvbGxvdyI+Cjx0aXRsZT5QaWN0dXJlIG9mIGFuIE9iamVjdDwvdGl0bGU+CjxsaW5rIHJlbD0ic3R5bGVzaGVldCIgdHlwZT0idGV4dC9jc3MiIGhyZWY9Ii4uL0NBSXN0eWxlUmV2Mi5jc3MiPgo8L2hlYWQ+Cgo8Ym9keT4KPCEtLSBnZW5lcmF0ZWQgYnkgQ1NTbWFrZXIuamF2YSwgdmVyc2lvbiAwNy8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KICAgICA8YSBocmVmPSJjaDI1XzUuaHRtbCI+PGltZyBzcmM9Ii4uL2JhY2tJY29uLmdpZiIgYWx0PSJnbyB0byBwcmV2aW91cyBwYWdlIj48L2E+ICZuYnNwOyAKICAgICA8YSBocmVmPSIuLi8uLi9pbmRleC5odG1sIzI1Ij48aW1nIHNyYz0iLi4vaG9tZUljb24uZ2lmIiBhbHQ9ImdvIHRvIGhvbWUgcGFnZSI+PC9hPiAmbmJzcDsKICAgICA8YSBocmVmPSJjaDI1XzcuaHRtbCI+PGltZyBzcmM9Ii4uL25leHRJY29uLmdpZiIgYWx0PSJnbyB0byBuZXh0IHBhZ2UiPjwvYT4KICAgICA8L2Rpdj4KPC9kaXY+Cgo8L2JvZHk+CjwvaHRtbD4K
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (1,4) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (1,4) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (1,4) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (2,6) : Error VBNC32035: Attributes can only appear just before a declaration.
/home/rnR61n/prog.vb (3,6) : Error VBNC32035: Attributes can only appear just before a declaration.
/home/rnR61n/prog.vb (4,12) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (4,12) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (4,12) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (5,11) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (5,11) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (5,11) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (6,11) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (6,11) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (6,11) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (7,11) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (7,11) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (7,11) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (8,15) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (8,15) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (9,10) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (9,10) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (9,10) : Error VBNC30203: Not valid as identifier.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (10,3) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (10,3) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (10,3) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (12,6) : Error VBNC32035: Attributes can only appear just before a declaration.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (13,3) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (13,3) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (13,3) : Error VBNC30203: Not valid as identifier.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (15,3) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (15,3) : Error VBNC99999: Hanging attributes.
/home/rnR61n/prog.vb (15,3) : Error VBNC30203: Not valid as identifier.
/home/rnR61n/prog.vb (17,11) : Error VBNC90019: Expected '>'.
Error recovery not implemented yet.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC90019: Expected '('.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC90019: Expected 'Of'.
Error recovery not implemented yet.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC90019: Expected ')'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC30205: Expected end of statement.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC90019: Expected 'End'.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC30205: Expected end of statement.
Error recovery not implemented yet.
/home/rnR61n/prog.vb (17,12) : Error VBNC99999: vbnc crashed nearby this location in the source code.
/home/rnR61n/prog.vb (17,12) : Error VBNC99999: Unexpected error: Object reference not set to an instance of an object
at vbnc.TypeDeclaration.Init (vbnc.Attributes CustomAttributes, Modifiers Modifiers, vbnc.MemberDeclarations Members, vbnc.Identifier Name, Int32 TypeArgumentCount) [0x00000] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/TypeDeclarations/TypeDeclaration.vb:109
at vbnc.GenericTypeDeclaration.Init (vbnc.Attributes CustomAttributes, Modifiers Modifiers, vbnc.MemberDeclarations Members, vbnc.Identifier Name, vbnc.TypeParameters TypeParameters) [0x0001f] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/TypeDeclarations/GenericTypeDeclaration.vb:36
at vbnc.PartialTypeDeclaration.Init (vbnc.Attributes CustomAttributes, Modifiers Modifiers, vbnc.MemberDeclarations Members, vbnc.Identifier Name, vbnc.TypeParameters TypeParameters, vbnc.TypeImplementsClauses Implements) [0x00000] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/TypeDeclarations/PartialTypeDeclaration.vb:43
at vbnc.ClassDeclaration.Init (vbnc.Attributes CustomAttributes, Modifiers Modifiers, vbnc.TypeDeclaration DeclaringType, vbnc.MemberDeclarations Members, vbnc.Identifier Name, vbnc.TypeParameters TypeParameters, vbnc.NonArrayTypeName Inherits, vbnc.TypeImplementsClauses TypeImplementsClauses) [0x00000] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/TypeDeclarations/ClassDeclaration.vb:47
at vbnc.Parser.ParseClassDeclaration (vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace) [0x001aa] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/Parser/Parser(Types).vb:91
at vbnc.Parser.ParseTypeDeclaration (vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace) [0x00010] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/Parser/Parser.vb:1436
at vbnc.Parser.ParseAssemblyMembers (vbnc.AssemblyDeclaration Parent, System.String RootNamespace, vbnc.MemberDeclarations declarations) [0x001a8] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/Parser/Parser.vb:1482
at vbnc.Parser.ParseAssemblyDeclaration (System.String RootNamespace, vbnc.AssemblyDeclaration assembly) [0x00092] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/Parser/Parser.vb:433
at vbnc.Parser.Parse (System.String RootNamespace, vbnc.AssemblyDeclaration assembly) [0x00002] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/Parser/Parser.vb:58
at vbnc.Compiler.Compile_Parse () [0x0006d] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:363
Compilation took 00:00:00.6203940
-
result: Compilation error (maybe you wish to see an example for VB.NET)



