<?xml version="1.0" encoding="us-ascii"?><InstanceReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Version>2.4.0.8</Version><ReportLongName>0010 - Disclosure - 3. Inventories</ReportLongName><DisplayLabelColumn>true</DisplayLabelColumn><ShowElementNames>false</ShowElementNames><RoundingOption /><HasEmbeddedReports>false</HasEmbeddedReports><Columns><Column FlagID="0"><Id>1</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><CurrencyCode /><FootnoteIndexer /><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios><MCU><KeyName /><CurrencySymbol /><contextRef><ContextID>From2012-07-01to2013-06-30</ContextID><EntitySchema>http://www.sec.gov/CIK</EntitySchema><EntityValue>0000028561</EntityValue><PeriodDisplayName /><PeriodType>duration</PeriodType><PeriodStartDate>2012-07-01T00:00:00</PeriodStartDate><PeriodEndDate>2013-06-30T00:00:00</PeriodEndDate><Segments /><Scenarios /></contextRef><UPS /><CurrencyCode /><OriginalCurrencyCode /></MCU><CurrencySymbol /><Labels><Label Key="CalendarSupplement" Id="0" Label="12 Months Ended" /><Label Key="Calendar" Id="1" Label="Jun. 30, 2013" /></Labels></Column></Columns><Rows><Row FlagID="0"><Id>1</Id><IsAbstractGroupTitle>true</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>1</Level><ElementName>DEWY_NotesToFinancialStatementsAbstract</ElementName><ElementPrefix>DEWY_</ElementPrefix><IsBaseElement>false</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText /><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>xbrli:stringItemType</ElementDataType><SimpleDataType>string</SimpleDataType><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>Notes to Financial Statements</Label></Row><Row FlagID="0"><Id>2</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>2</Level><ElementName>us-gaap_InventoryDisclosureTextBlock</ElementName><ElementPrefix>us-gaap_</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><PreferredLabelRole>verboseLabel</PreferredLabelRole><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="From2012-07-01to2013-06-30" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText>&lt;table cellspacing="0" cellpadding="0" style="font: 8pt Times New Roman, Times, Serif; width: 100%"&gt;
&lt;tr style="vertical-align: bottom; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 1.5pt; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td colspan="6" style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif; text-align: center"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;b&gt;June
    30,&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td colspan="2" style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif; text-align: center"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;b&gt;2013&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td colspan="2" style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif; text-align: center"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;b&gt;2012&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td colspan="2" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td colspan="2" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="width: 78%; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Finished
    goods&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 1%; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 1%; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 8%; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;24,592&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="width: 1%; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 1%; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 1%; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 8%; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;26,027&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="width: 1%; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Work in progress&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;310,836&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;200,939&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Raw
    materials&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 1.5pt; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;886,516&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 1.5pt; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt solid; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;554,071&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 1.5pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white; font: 8pt Times New Roman, Times, Serif"&gt;
    &lt;td style="padding-bottom: 3pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 3pt; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 2.25pt double; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 2.25pt double; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;1,221,944&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 3pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="padding-bottom: 3pt; text-align: right; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 2.25pt double; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 2.25pt double; font: 8pt Times New Roman, Times, Serif; text-align: right"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;781,037&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="padding-bottom: 3pt; font: 8pt Times New Roman, Times, Serif"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</NonNumbericText><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>nonnum:textBlockItemType</ElementDataType><SimpleDataType>na</SimpleDataType><ElementDefenition>The entire disclosure for inventory. This may include, but is not limited to, the basis of stating inventory, the method of determining inventory cost, the major classes of inventory, and the nature of the cost elements included in inventory. If inventory is stated above cost, accrued net losses on firm purchase commitments for inventory and losses resulting from valuing inventory at the lower-of-cost-or-market may also be included. For LIFO inventory, may disclose the amount and basis for determining the excess of replacement or current cost over stated LIFO value and the effects of a LIFO quantities liquidation that impacts net income.</ElementDefenition><ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Accounting Standards Codification

 -Topic 210

 -SubTopic 10

 -Section 50

 -Paragraph 1

 -URI http://asc.fasb.org/extlink&amp;oid=6361739&amp;loc=d3e7789-107766



Reference 2: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Accounting Standards Codification

 -Topic 210

 -SubTopic 10

 -Section S99

 -Paragraph 1

 -Subparagraph (SX 210.5-02.6)

 -URI http://asc.fasb.org/extlink&amp;oid=6877327&amp;loc=d3e13212-122682



Reference 3: http://www.xbrl.org/2003/role/presentationRef

 -Publisher SEC

 -Name Regulation S-X (SX)

 -Number 210

 -Section 02

 -Paragraph 6

 -Subparagraph a, b, c

 -Article 5



</ElementReferences><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>Inventories</Label></Row></Rows><Footnotes /><IsEquityReport>false</IsEquityReport><ReportName>3. Inventories</ReportName><MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel><SharesRoundingLevel>UnKnown</SharesRoundingLevel><PerShareRoundingLevel>UnKnown</PerShareRoundingLevel><ExchangeRateRoundingLevel>UnKnown</ExchangeRateRoundingLevel><HasCustomUnits>true</HasCustomUnits><IsEmbedReport>false</IsEmbedReport><IsMultiCurrency>false</IsMultiCurrency><ReportType>Sheet</ReportType><RoleURI>http://deweyelectronics.com/role/Inventories</RoleURI><NumberOfCols>1</NumberOfCols><NumberOfRows>2</NumberOfRows></InstanceReport>
