首页编程java编程java items是什么意思 java (String) s.peek()是什么意思

java items是什么意思 java (String) s.peek()是什么意思

编程之家2023-10-13120次浏览

大家好,今天来为大家分享java items是什么意思的一些知识点,和java (String) s.peek()是什么意思的问题解析,大家要是都明白,那么可以忽略,如果不太清楚的话可以看看本篇文章,相信很大概率可以解决您的问题,接下来我们就一起来看看吧!

java items是什么意思 java (String) s.peek()是什么意思

java (String) s.peek()是什么意思

s.peek()表示的是查看堆栈顶部的对象,但不从堆栈中移除它。

除此之外:

push(E item)表示的是把项压入堆栈顶部。

java items是什么意思 java (String) s.peek()是什么意思

pop()表示的是移除堆栈顶部的对象,并作为此函数的值返回该对象。

empty()表示的是测试堆栈是否为空。

search(Object o)表示的是返回对象在堆栈中的位置,以 1为基数。

java items是什么意思 java (String) s.peek()是什么意思

以下是从jdk中拿下来的相关方法的源码,可以参看下:

publicclassStack<E>extendsVector<E>{

/**

*CreatesanemptyStack.

*/

publicStack(){

}

/**

*Pushesanitemontothetopofthisstack.Thishasexactly

*thesameeffectas:

*<blockquote><pre>

*addElement(item)</pre></blockquote>

*

*@paramitemtheitemtobepushedontothisstack.

*@returnthe<code>item</code>argument.

*@seejava.util.Vector#addElement

*/

publicEpush(Eitem){

addElement(item);

returnitem;

}

/**

*Removestheobjectatthetopofthisstackandreturnsthat

*objectasthevalueofthisfunction.

*

*@returnTheobjectatthetopofthisstack(thelastitem

*ofthe<tt>Vector</tt>object).

*@exceptionEmptyStackExceptionifthisstackisempty.

*/

publicsynchronizedEpop(){

E obj;

int len=size();

obj=peek();

removeElementAt(len-1);

returnobj;

}

/**

*Looksattheobjectatthetopofthisstackwithoutremovingit

*fromthestack.

*

*@returntheobjectatthetopofthisstack(thelastitem

*ofthe<tt>Vector</tt>object).

*@exceptionEmptyStackExceptionifthisstackisempty.

*/

publicsynchronizedEpeek(){

int len=size();

if(len==0)

thrownewEmptyStackException();

returnelementAt(len-1);

}

/**

*Testsifthisstackisempty.

*

*@return<code>true</code>ifandonlyifthisstackcontains

*noitems;<code>false</code>otherwise.

*/

publicbooleanempty(){

returnsize()==0;

}

/**

*Returnsthe1-basedpositionwhereanobjectisonthisstack.

*Iftheobject<tt>o</tt>occursasaniteminthisstack,this

*methodreturnsthedistancefromthetopofthestackofthe

*occurrencenearestthetopofthestack;thetopmostitemonthe

*stackisconsideredtobeatdistance<tt>1</tt>.The<tt>equals</tt>

*methodisusedtocompare<tt>o</tt>tothe

*itemsinthisstack.

*

*@paramothedesiredobject.

*@returnthe1-basedpositionfromthetopofthestackwhere

*theobjectislocated;thereturnvalue<code>-1</code>

*indicatesthattheobjectisnotonthestack.

*/

publicsynchronizedintsearch(Objecto){

inti=lastIndexOf(o);

if(i>=0){

returnsize()-i;

}

return-1;

}

/**useserialVersionUIDfromJDK1.0.2forinteroperability*/

privatestaticfinallongserialVersionUID=1224463164541339165L;

}

GUI是什么意思

GUI美[.dʒi ju'aɪ]英[.dʒiː juː'aɪ]

(1)、abbr.图形用户界面

(2)、网络:图形用户界面(Graphical User Interface);图形用户接口;图形界面

【扩展资料】:

1、The OATprovidesasimple, easy-to-useGUIfor theDBAtoobtain thecurrentperformancedetailsofIDS.

OAT通过一个容易使用的GUI向DBA提供当前的详细IDS性能数据。

2、Andwiththevast numberofinvariantsthat must becheckedforaGUIprogram,automatedtestingisessential.

由于GUI程序中有大量的不变量需要检查,因此,自动化测试是必需的。

3、The padlockintheKeychainAccessGUIisjustaGUIfeature,it doesnotrelate tounlockingsmart carditemswithaPINcode.

padlock在密钥链访问图形用户界面中只是一个图形用户界面特征,不涉及到用一个PIN码解锁智能卡条目。

Java中的Vector是什么意思

vector与数组类似,但能被扩大和缩小。

向量与数组的区别:

1、Java的数组可存储任何类型的数组元素,包括数值类型和所有类类型

2、Java向量只能存储对象类的实例。

向量能重定位和调整自己的容量。缺省时,向量重定位一次,其容量就扩大一倍,呈指数增长,所以应指定容量增量,做为向量构造函数的第二个参数,来创建向量:

Vector itemsOrdered= new Vector(3.10);这样向量每重定位一次,其容量都增加10个元素。

v.size()返回向量中的元素个数,等价于 arry.length();

如果向量已达到其永久大小,则可调用tirmToSize方法,将内存块大小调整到刚好能容纳当前个数的向量元素

向量中不能用方便的[]句法,而必须用elementAt和setSlementAt方法来访问或修改元素。

数组:x= a[i](访问) a[i]= x;(修改)

向量:x= v.elementAt(i) v.SetElementAt(x.i)

java中使用el

EL

隐式对象

类别标识符描述

JSP

pageContext

PageContext

实例对应于当前页面的处理

作用域pageScope

与页面作用域属性的名称和值相关联的

Map

类

requestScope

与请求作用域属性的名称和值相关联的

Map

类

sessionScope

与会话作用域属性的名称和值相关联的

Map

类

applicationScope

与应用程序作用域属性的名称和值相关联的

Map

类

请求参数param按名称存储请求参数的主要值的

Map

类

paramValues

将请求参数的所有值作为

String

数组存储的

Map

类

请求头

header

按名称存储请求头主要值的

Map

类

headerValues将请求头的所有值作为

String

数组存储的

Map

类

Cookie

cookie按名称存储请求附带的

cookie

的

Map

类

初始化参数

initParam

按名称存储

Web

应用程序上下文初始化参数的

Map

类

关于java items是什么意思和java (String) s.peek()是什么意思的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

java面板监听什么意思(java中为什么要设置监听器,有什么用)刚学java 看什么书 初学者学习JAVA买什么书好
↑