Java/C2/Creating-object/Gujarati
From Script | Spoken-Tutorial
Revision as of 15:34, 19 August 2013 by Jyotisolanki (Talk | contribs)
| Time' | Narration |
| 00:01 | Creating objects પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે. |
| 00:05 | Iઆ ટ્યુટોરીયલમાં આપણે આપેલ વિશે શીખીશું:
* સંદર્ભિત વેરીએબલો * ઘટકોનું બંધારણ અને * ઘટકો માટે મેમરીની ફાળવણીcts
|
| 00:13 | અહીં, આપણે વાપરી રહ્યા છીએ
* ઉબુન્ટુ ૧૧.૧૦ * જેડીકે ૧.૬ અને * એક્લીપ્સ IDE ૩.૭.૦ |
| 00:23 | આ ટ્યુટોરીયલનાં અનુસરણ માટે તમને જાણ હોવી જોઈએ કે કેવી રીતે એક્લીપ્સ નાં ઉપયોગ વડે સાદું ક્લાસ બનાવવું. |
| 00:29 | જો નથી તો કૃપા કરી spoken hyphen tutorial dot org પર ઉપલબ્ધ આ વિષયો પરનાં સ્પોકન ટ્યુટોરીયલ જુઓ. |
| 00:38 | આપણે જાણીએ છીએ કે વેરીએબલો' અને મેથડો બંને સાથે મળીને ક્લાસનાં મેમ્બરો બનાવે છે. |
| 00:43 | ક્લાસનાં મેમ્બરોને એક્સેસ કરવા માટે, આપણને ક્લાસ માટે ઓબજેક્ટ બનાવવાની જરૂર છે. |
| 00:48 | હવે ચાલો જોઈએ કે ઓબજેક્ટ શું છે.
|
| 00:52 | ઓબજેક્ટ એ ક્લાસનું દ્રષ્ટાંત છે.
|
| 00:55 | દરેક ઓબજેક્ટ state અને behavior થી બનેલો છે.
|
| 00:58 | human being class નું ઉદાહરણ યાદ કરો જેની ચર્ચા આપણે પહેલાનાં ટ્યુટોરીયલમાં કરી હતી.
|
| 01:04 | ઓબજેક્ટ તેની સ્થિતિને ફીલ્ડો અથવા વેરીએબલો માં સંગ્રહીત કરે છે. |
| 01:08 | તે તેના વર્તનને methods દ્વારા ખુલ્લું કરે છે. |
| 01:11 | હવે ચાલો રેફરેન્સ વેરીએબલો વિશે શીખીએ.
|
| 01:15 | આપણે જાવામાનાં 8 પ્રાથમિક કક્ષાનાં ડેટા પ્રકારો વિશે જાણીએ છીએ.
|
| 01:19 | પ્રાથમિક કક્ષા શિવાયનાં તમામ બીજા અન્ય પ્રકારો ઓબજેક્ટો ને સંદર્ભ કરે છે.
|
| 01:23 | વેરીએબલો જે ઓબજેક્ટને સંદર્ભ કરે છે તે રેફરેન્સ વેરીએબલો છે. |
| 01:28 | ચાલો Student ક્લાસ પર પાછા જઈએ જેને આપણે પહેલાનાં ટ્યુટોરીયલમાં પહેલાથી જ બનાવ્યું છે.
|
| 01:37 | હવે ચાલો હું આ ક્લાસ માંથી મુખ્ય મેથડ ને રદ્દ કરું.
|
| 01:49 | હવે Control અને S કી એકસાથે દાબીને ફાઈલને સંગ્રહીત કરો.
|
| 01:55 | હવે એજ પ્રોજેક્ટની અંદર TestStudent નામનો બીજો એક ક્લાસ બનાવો.
|
| 02:00 | મેં તે પહેલાથી જ બનાવ્યો છે.
|
| 02:03 | આ ક્લાસ માં મારી પાસે main મેથડ છે. |
| 02:06 | હવે main મેથડ ની અંદર હું Student ક્લાસ નું ઓબજેક્ટ બનાવીશ.
|
| 02:11 | તે માટે main મેથડ ની અંદર, ટાઈપ કરો
|
| 02:17 | 'Student સ્પેસ stud1 બરાબર new સ્પેસ Student ખુલ્લો અને બંધ કૌંસ, અર્ધવિરામ'. |
| 02:34 | આ રીતે આપણે Student ક્લાસ નું ઓબજેક્ટ બનાવી લીધું છે.
|
| 02:37 | Here, Student is the name of the class for which the object is to be created.
|
| 02:47 | stud1 is a reference variable referring to one object of the Student class.
|
| 02:53 | And the new keyword allocates space for the new object to be created.
|
| 02:59 | Please note that stud1 is not the object of the Student class.
|
| 03:03 | It only holds the reference of the new object created.
|
| 03:09 | Now, let us see what stud1 contains.
|
| 03:13 | So next line type System dot out dot println within brackets and double quotes stud1 contains space plus stud1 and then semicolon.
|
| 03:44 | Now, save and run the file TestStudent dot java. |
| 03:53 | We get the output as follows.
|
| 03:56 | So here Student is the name of the class of the new object created.
|
| 04:03 | The second part is the memory address of the new object created.
|
| 04:08 | We can access the fields and methods of the Student class using stud1.
|
| 04:15 | We will learn about these in the coming tutorials. |
| 04:18 | Now, I will create one more object of the Student class.
|
| 04:24 | So, I will type Student space stud2 equal to new space Student opening and closing brackets semi-colon. |
| 04:47 | Now type next line System dot out dot println within brackets and double quotes stud2 contains space plus stud2 and then semicolon.
|
| 05:19 | Now, let us save and run this file. |
| 05:25 | We can see that here stud1 and stud2 refers to two different objects.
|
| 05:31 | That is, stud1 and stud2 are referring to two different students.
|
| 05:37 | They have different roll numbers and names. |
| 05:44 | Now, we can make a change here.
|
| 05:51 | Here type Student stud2 equal to stud1.
|
| 06:01 | Now, save and run this file.
|
| 06:06 | We can see that here both stud1 and stud2 refers to the same object.
|
| 06:12 | That means both stud1 and stud2 are referring to the same object with a roll number and name. |
| 06:31 | So in this tutorial we learnt about |
| 06:34 | Reference variables |
| 06:35 | Creating object using new operator |
| 06:38 | And Assigning references
|
| 06:41 | For self assessment |
| 06:43 | create another class named TestEmployee. |
| 06:46 | Create an object of the Employee class with reference variable as emp1.
|
| 06:52 | To know more about the spoken tutorial project. |
| 06:55 | Watch the video available at http://spoken-tutorial.org/What_is_a_Spoken_Tutorial |
| 06:58 | It summarises the Spoken Tutorial project |
| 07:01 | If you do not have good bandwidth, you can download and watch it
|
| 07:05 | The Spoken Tutorial Project Team |
| 07:07 | Conducts workshops using spoken tutorials |
| 07:10 | Gives certificates for those who pass an online test |
| 07:14 | For more details, please write to contact@spoken-tutorial.org
|
| 07:20 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
| 07:24 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
| 07:31 | More information on this Mission is available at
http://spoken-tutorial.org/NMEICT-Intro
|
| 07:40 | Thus we have come to the end of this tutorial. |
| 07:43 | This is Arya Ratish from IIT Bombay signing off. |
| 07:46 | Thanks for joining us. |