1

00:00:00,960  -->  00:00:04,120
Let's now go ahead and write a Java program in Eclipse.

2

00:00:04,230  -->  00:00:06,480
So let's just go ahead and launch eclipse.

3

00:00:06,500  -->  00:00:08,810
It's just double click this icon here.

4

00:00:09,480  -->  00:00:15,660
So first thing eclipse wants us to do is it wants us to select something as a workspace or we need to

5

00:00:15,660  -->  00:00:21,240
create a new workspace workspace basically represents our application.

6

00:00:21,420  -->  00:00:25,310
So it's the place where we on our source code gets stored.

7

00:00:25,590  -->  00:00:31,770
So within a workspace we create a project and the project has this our source code and the workspace

8

00:00:31,900  -->  00:00:33,940
and how more than one projects do.

9

00:00:34,320  -->  00:00:36,170
And those projects can be interrelated.

10

00:00:36,180  -->  00:00:39,910
Usually it's if there are multiple projects that are usually interrelated.

11

00:00:40,020  -->  00:00:44,340
So there is already a workspace here but let's just go ahead and create a brand new one.

12

00:00:44,580  -->  00:00:53,940
So let's browse a look see dry within C-Drive let me create a new workspace called Jayati to new folder

13

00:00:54,300  -->  00:00:57,200
which is short for Jawa and.

14

00:00:57,470  -->  00:00:58,330
OK.

15

00:00:58,770  -->  00:01:03,520
OK here now eclipse would launch a new workspace.

16

00:01:03,590  -->  00:01:10,530
Now if we go into our explorer let me refresh this as you can see it has created a new folder on my

17

00:01:10,530  -->  00:01:11,150
C drive.

18

00:01:11,190  -->  00:01:12,090
Congi ID.

19

00:01:12,150  -->  00:01:14,190
So it's basically the workspace.

20

00:01:14,370  -->  00:01:20,240
And within this workspace all the source code that we write in eclipse would get stored here.

21

00:01:20,370  -->  00:01:22,420
OK so the project get stored here.

22

00:01:22,710  -->  00:01:28,520
The project can also get stored there is an option to also write the project extra Netaji ID extra to

23

00:01:28,520  -->  00:01:30,560
the workspace and then get to the workspace.

24

00:01:30,570  -->  00:01:32,290
That option is also there.

25

00:01:32,760  -->  00:01:33,020
OK.

26

00:01:33,030  -->  00:01:36,870
So let's just go ahead and create one project.

27

00:01:36,870  -->  00:01:40,300
So let's just close this welcome screen.

28

00:01:40,560  -->  00:01:47,010
So before creating our project I would like to just take a moment to talk about something cardless gelap

29

00:01:47,030  -->  00:01:51,620
perspective about prospectives perspective is basically it.

30

00:01:51,870  -->  00:01:54,840
It basically represents a view of your project.

31

00:01:54,870  -->  00:01:55,900
The project that you create.

32

00:01:55,920  -->  00:01:57,500
It's a view of your project.

33

00:01:57,670  -->  00:01:57,980
OK.

34

00:01:57,990  -->  00:01:59,820
So here there is the Djala.

35

00:01:59,850  -->  00:02:01,130
Each prospect do.

36

00:02:01,350  -->  00:02:05,800
So that's getting shown by default if you want to see it look at other perspectives.

37

00:02:06,000  -->  00:02:12,930
You just need to click on this icon called open perspective and hit all the different perspectives that

38

00:02:12,930  -->  00:02:14,230
Eclipse provides.

39

00:02:14,340  -->  00:02:18,740
And here is Ajalon one on here is a debug sort of just click on debug.

40

00:02:19,370  -->  00:02:25,290
So it just brings a different view of the project and you can also create Java.

41

00:02:25,440  -->  00:02:29,730
Let's just select Java and debug one table.

42

00:02:29,920  -->  00:02:35,590
You know when we are covering the debug debugging listen we will be looking at that interface.

43

00:02:35,790  -->  00:02:38,410
Ok now this is a different interface.

44

00:02:38,670  -->  00:02:45,830
And so as we are selecting them they get laid out here and the top and we can switch across also.

45

00:02:45,930  -->  00:02:47,180
So that's the perspective.

46

00:02:47,180  -->  00:02:50,710
So basically it represents a view of your project.

47

00:02:50,910  -->  00:02:57,930
Let's just look at the Java aspect do so within the Java perspective like you have these different frames

48

00:02:58,260  -->  00:03:00,890
and each frame we call it as a view.

49

00:03:00,900  -->  00:03:06,750
So here you have the package Explorer View and package Explorer have you as a name suggests it is used

50

00:03:06,750  -->  00:03:09,610
for exploring your projects your packages.

51

00:03:09,780  -->  00:03:14,790
So within Java library within the Java code that we create usually we have packages and within the package

52

00:03:14,790  -->  00:03:21,720
just be how classes are if we select a particular class then the source code of that class show up shows

53

00:03:21,720  -->  00:03:22,280
up here.

54

00:03:22,280  -->  00:03:25,990
This is the textedit of this is the editor of view.

55

00:03:26,200  -->  00:03:32,880
And here you know if you under if you're under a particular class file then the output of dight will

56

00:03:32,880  -->  00:03:35,240
be shown here and you will get opened.

57

00:03:35,370  -->  00:03:40,180
It's called as a console you know it gets open here and we'll be able to see the output.

58

00:03:40,380  -->  00:03:43,740
Let's not worry about these other views here.

59

00:03:43,830  -->  00:03:47,460
So these are the three main news that we have.

60

00:03:47,520  -->  00:03:49,740
That's the perspective on the views.

61

00:03:49,740  -->  00:03:53,390
So let's just go ahead and create a new project.

62

00:03:53,940  -->  00:03:56,810
We are going to file new.

63

00:03:57,250  -->  00:04:00,560
It's quick on this job project.

64

00:04:00,690  -->  00:04:08,490
It's quoted as Eclipse best and we are saying that use the default location which means that it's going

65

00:04:08,490  -->  00:04:16,020
to get created an NGO idea itself and the database and the execution environment that GRV that we are

66

00:04:16,020  -->  00:04:22,540
using is Jawa as eat and we are saying that creates separate folders for sources unclassified.

67

00:04:22,590  -->  00:04:28,310
OK so you'll have separate folders for both source code and the compiled classifieds.

68

00:04:28,440  -->  00:04:30,400
OK hit next.

69

00:04:31,290  -->  00:04:37,780
OK so as you can see a new project has got created here and here we have something called Jawa Bell

70

00:04:37,790  -->  00:04:38,570
settings.

71

00:04:38,610  -->  00:04:43,800
This is nothing but you know all the libraries that this particular code that we are going to write

72

00:04:43,800  -->  00:04:47,980
is going to be shown here and we can add those libraries here.

73

00:04:48,180  -->  00:04:53,550
But when this is called a Java belled settings on we will get back to that later in the next lesson

74

00:04:53,550  -->  00:04:54,520
.

75

00:04:54,560  -->  00:04:54,990
That's it.

76

00:04:54,990  -->  00:05:02,100
And I just had to finish and if you see you'll have a folder called S R C and we are depending on this

77

00:05:02,100  -->  00:05:03,090
library in Java.

78

00:05:03,100  -->  00:05:05,210
I see one point eight.

79

00:05:05,220  -->  00:05:08,140
Now let's just let's just look in the explorer 2.

80

00:05:08,190  -->  00:05:13,530
So if you're going to JRD you can see there is a new folder called Eclipse disk that God created.

81

00:05:13,530  -->  00:05:15,580
Click on that you will see SIRC.

82

00:05:15,600  -->  00:05:19,750
So in this ARCI for you go to any source code that we cleared and gets stored here.

83

00:05:20,070  -->  00:05:25,550
And once it gets compiled the compiled files will be stored in the bin folder.

84

00:05:26,930  -->  00:05:29,300
Let's go ahead and create a class.

85

00:05:29,690  -->  00:05:33,410
So let's just right click on the project and let's send.

86

00:05:34,190  -->  00:05:41,050
And let's click on class Let's name the class as Hello world.

87

00:05:41,440  -->  00:05:41,900
OK.

88

00:05:41,930  -->  00:05:47,720
So modify this public superclasses dollar dog Langhart object and which method set up.

89

00:05:47,720  -->  00:05:52,630
So would you like to create which just select this so that the main method would be auto created and

90

00:05:52,780  -->  00:05:54,860
that's it said we can just leave it as it is.

91

00:05:54,870  -->  00:05:57,760
Heck finish this work.

92

00:05:57,830  -->  00:06:03,180
Create a new class as you can see the font sizes.

93

00:06:03,260  -->  00:06:04,190
It's small.

94

00:06:04,370  -->  00:06:06,870
So let's just add logic.

95

00:06:06,920  -->  00:06:12,020
So for DAC we can go into the window and there is something called preferences.

96

00:06:12,020  -->  00:06:18,210
Let's go ahead and hit preferences and preferences show you how all these options here.

97

00:06:18,280  -->  00:06:23,000
And let's just select the first one with just Gendron and Biton gender you can see that there is this

98

00:06:23,000  -->  00:06:24,480
thing called us once.

99

00:06:24,540  -->  00:06:27,780
OK let's click on appearance and that is colors on phones.

100

00:06:27,780  -->  00:06:31,910
Let's click on colors on fonts on within colors on fonts.

101

00:06:31,910  -->  00:06:38,070
Since we are dealing with Jellico Let's go into Java and let's head this thing edit a text font.

102

00:06:38,270  -->  00:06:44,600
OK so let's just click that and you can see that we have these different font sizes let's select 16

103

00:06:44,600  -->  00:06:46,350
for example.

104

00:06:46,400  -->  00:06:48,500
OK apply.

105

00:06:48,880  -->  00:06:49,590
OK.

106

00:06:49,880  -->  00:06:51,540
Now the font size has increased.

107

00:06:51,650  -->  00:06:52,170
OK.

108

00:06:52,370  -->  00:06:55,060
Now let's put some statements here.

109

00:06:55,160  -->  00:07:00,400
Let's put this out statement system not out just typing this out.

110

00:07:00,570  -->  00:07:08,540
Can crawl space that for being up this thing and you could click that you know the court is auto generated

111

00:07:08,540  -->  00:07:09,030
.

112

00:07:09,050  -->  00:07:10,080
Now let's just put them.

113

00:07:10,100  -->  00:07:12,310
Hello here.

114

00:07:12,350  -->  00:07:20,060
So in order to run this all we need to do is right click see Iran as unselect this Java application

115

00:07:20,210  -->  00:07:25,960
option are the simpler way is to simply click on this button here or on us.

116

00:07:26,000  -->  00:07:32,270
Let's just click that as you can see the console view has open now and it's showing the output here

117

00:07:32,270  -->  00:07:32,850
.

118

00:07:33,050  -->  00:07:39,410
Now by any chance if you happen to believe this here by me you know accidentally then all you need to

119

00:07:39,410  -->  00:07:45,740
do is once again go back in big window and here you have show you show which is nothing but it shows

120

00:07:45,830  -->  00:07:48,490
all the views that we have in this perspective.

121

00:07:48,730  -->  00:07:49,020
OK.

122

00:07:49,040  -->  00:07:52,640
So the one the one the view which we lost is the console.

123

00:07:52,670  -->  00:07:57,990
So it's quick on that and it's back again with the output that was there earlier.

124

00:07:58,460  -->  00:07:59,680
That's the console you.

125

00:07:59,780  -->  00:08:02,550
Now let's go ahead and put some statements here.

126

00:08:02,570  -->  00:08:07,690
So let's say long a was 42.

127

00:08:07,700  -->  00:08:10,810
Now let's assign it to an I.

128

00:08:11,300  -->  00:08:15,050
Now as you can see it is giving us a compilation error.

129

00:08:15,050  -->  00:08:21,650
So you see this that red icon here it says Type mismatch because you cannot convert from long to and

130

00:08:21,810  -->  00:08:22,750
.

131

00:08:23,520  -->  00:08:23,890
OK.

132

00:08:23,900  -->  00:08:29,730
Now when I save it it also gets shown here in problems view.

133

00:08:29,960  -->  00:08:33,560
So if I expand it I can see the same message here.

134

00:08:33,560  -->  00:08:35,880
Now let's just go ahead and fix this.

135

00:08:36,020  -->  00:08:39,710
So let's put the typecast here and it's fixed.

136

00:08:39,710  -->  00:08:46,830
So the error of the compassion has gone back to showing another yellow symbol here icon.

137

00:08:46,850  -->  00:08:48,490
It's it's just a warning.

138

00:08:48,500  -->  00:08:52,000
It says that the blue of the local variable is not used.

139

00:08:52,100  -->  00:08:57,270
Right because we are not using the value I it is being used here but I is not yet used.

140

00:08:57,380  -->  00:08:59,980
So it's just a warning it's not a compiler error.

141

00:09:00,180  -->  00:09:04,410
And the same warning also gets shown here and.

142

00:09:04,450  -->  00:09:04,780
Yeah.

143

00:09:04,820  -->  00:09:09,720
So that's sub-Arctic like how you were running or you just click on this button here and you run it

144

00:09:09,730  -->  00:09:10,060
.

145

00:09:10,310  -->  00:09:14,310
That is one other thing I wanted to that is going to bring reference's.

146

00:09:14,540  -->  00:09:17,890
So we look up how to change the font.

147

00:09:18,260  -->  00:09:28,220
And there is also this option called editors if you go in to editor text editor here and you have some

148

00:09:28,220  -->  00:09:33,140
other options like showing the line numbers by default because it has been selected here if you do this

149

00:09:33,260  -->  00:09:34,640
and you say I applied.

150

00:09:34,700  -->  00:09:40,680
So the line numbers would go heavy but we does I think really nice to have the line numbers so let's

151

00:09:40,700  -->  00:09:45,200
just put them back and there are also other options here.

152

00:09:45,230  -->  00:09:49,790
You can check them out and play around with them.

153

00:09:51,020  -->  00:09:55,220
Also here in the package explorer we can explore the classes that we created.

154

00:09:55,220  -->  00:09:56,570
So here is a Hollywood.

155

00:09:56,810  -->  00:09:58,840
And here is a method that we created.

156

00:09:58,880  -->  00:10:05,150
So if there were more methods they would have shown up here under under the class I find this is the

157

00:10:05,150  -->  00:10:06,130
package name.

158

00:10:06,140  -->  00:10:12,000
So when we created the class it picked the project name as the package name itself.

159

00:10:12,200  -->  00:10:17,490
So we could have given a different name but we just let that be false as it as it is.

160

00:10:17,670  -->  00:10:19,720
And here in the main method.

161

00:10:19,880  -->  00:10:23,410
So if you're for the print alone if you just haul it over it here.

162

00:10:23,630  -->  00:10:26,710
So I chose the Java doc off that particular print method.

163

00:10:26,720  -->  00:10:29,400
So it allows us to look at the description of the matter.

164

00:10:29,540  -->  00:10:30,320
OK.

165

00:10:30,830  -->  00:10:36,380
And here is the class system and it says something about the system so it's a dollar Dawk for the class

166

00:10:36,380  -->  00:10:37,240
itself.

167

00:10:37,550  -->  00:10:42,440
Now let me just go back to here today Explorer.

168

00:10:42,470  -->  00:10:46,730
So we this is the workspace and this is this odyssey for gold which has the source code.

169

00:10:46,730  -->  00:10:47,920
Now if we go into Ben.

170

00:10:48,140  -->  00:10:50,590
So it has the class files.

171

00:10:50,960  -->  00:10:52,960
The classifieds that Gajah undeterred will be here.

172

00:10:53,060  -->  00:10:59,390
So this is a package an eclipse d'Este and within Eclipse's we have the Holloway got class file.

173

00:10:59,390  -->  00:11:00,570
So that's about it
