一、Rather Than 和 Instead Of 有什么区别
rather than是连词,表否定后边的,"而不是."
instead of是副词,意思跟rather than差不多,都表示否定后面的部分,只是在句子中的位置有些区别
一、rather than用作连词,连接两个平行结构.既可以表示主观愿望上的决择,“与其…宁可…”,也可以表示客观程度上的差异,“与其说是…不如说是…”.例如:
1、接代词
1)I,rather than you,should do the work.
该做这工作的是我,而不是你.
2、接名词
2)John ought to go rather than Jean.约翰比琴更应该去.
3)I think I'll have a cold drink rather than coffee.
我想我该要一杯冷饮,而不要咖啡.
试比较:
4)We sometimes eat rice instead of potatoes.
有时候我们不吃土豆,而吃米饭.
3、接形容词
5)These shoes are comfortable rather than for your friend.
这鞋不好看可是舒服.
6)You are doing this for yourself rather than for your friend.
你不是为你朋友,而是为你自己做这种事.
7)I'd prefer to go in August rather than in July.我愿8月去不愿7月去.
5、接动名词
8)I always prefer starting early,rather than leaving everything to the last minute,
我总是愿意早开始而不愿意把所有事情都留到最后才做.
9)He was engaged in writing a letter rather than reading the newspaper.
他那时是在写信而不是看报纸.
6、接过去分词
10)She insisted on having the room papered rather than painted.
她坚持要用纸裱糊房间,而不是把房间粉刷一下.
7、接不定式
11)I decided to write rather than telephone.我决定写信而不是打电话.
12)They prefer to die fighting rather than live in enslavement.
他们宁可战死,也不肯活着受奴役.
13)I prefer to work rather than remain idle.我宁愿工作而不愿闲着.
8、接谓语动词
14)He told a lie rather than get his friend into trouble.
他宁愿说谎也不愿连累朋友.
15)Shall we go for a walk rather than watch television?
咱们不看电视,出去散步,好不好?
16)He ran rather than walked.他跑步而不是步行.
rather than后接动词原形表示主观抉择,接一个动词的过去式则表示客观差异.
9、接从句
17)It was what he meant rather than what he said.
那是指他话中的意思,而不是他所说的话.
18)It was what he had caten rather than what he had drunk that made him ill.使他得病的不是他喝的东西,而是他吃的东西.
二、rather than用作介词
R.Quirk编著的《英语语法大全》p.1387明确指出:和as well as及in stead of一样,rather than后面跟一个和母句中的动词形式并不匹配的ing分词分句时,它是介词,而不是准并列连词:
19)Their actions precipitated the war rather than averting it.
他们的行为促使战争爆发而不是避免战争.
20)Rather than a new car,he bought a colour television.
他买了一台彩电,而不是一辆新车.
21)Let's finish the job today,rather than leaving it till tomorrow.
让咱们今天干完工作,而不是留到明天.
三、rather than用作从属连词,引导一种优选分句.
R.Quirk在《英语语法大全》p.1540指出:优先分句主要用从属连词rather than和sooner than引导,用不带to的不定式作该分句的谓语动词:
22)Rather than go there by air,I'd take the slowest train.
我宁愿乘最慢的火车,也不愿乘飞机去那儿.
二、java 和 getAbsolutePath() 有中 file的getpath 啥区别
publicstaticvoidtest1(){
Filefile1=newFile(".\\test1.txt");
Filefile2=newFile("D:\\workspace\\test\\test1.txt");
System.out.println("-----默认相对路径:取得路径不同------");
System.out.println(file1.getPath());
System.out.println(file1.getAbsolutePath());
System.out.println("-----默认绝对路径:取得路径相同------");
System.out.println(file2.getPath());
System.out.println(file2.getAbsolutePath());
}
得到的结果:
-----默认相对路径:取得路径不同------
.\test1.txt
D:\workspace\test\.\test1.txt
-----默认绝对路径:取得路径相同------
D:\workspace\test\test1.txt
D:\workspace\test\test1.txt
因为getPath()得到的是构造file的时候的路径。
getAbsolutePath()得到的是全路径
如果构造的时候就是全路径那直接返回全路径
如果构造的时候试相对路径,返回当前目录的路径+构造file时候的路径
三、Java中getAbsolutePath()什么意思
参见下面demo,就知道它的含义了。
getAbsolutePath():返回抽象路径名的绝对路径名字符串。
public static void test1(){
File file1= new File(".\\test1.txt");
File file2= new File("D:\\workspace\\test\\test1.txt");
System.out.println("-----默认相对路径:取得路径不同------");
System.out.println(file1.getPath());
System.out.println(file1.getAbsolutePath());
System.out.println("-----默认绝对路径:取得路径相同------");
System.out.println(file2.getPath());
System.out.println(file2.getAbsolutePath());
}
-----默认相对路径:取得路径不同------
.\test1.txt
D:\workspace\test\.\test1.txt
-----默认绝对路径:取得路径相同------
D:\workspace\test\test1.txt
D:\workspace\test\test1.txt
public static void test2() throws Exception{
File file= new File("..\\src\\test1.txt");
System.out.println(file.getAbsolutePath());
System.out.println(file.getCanonicalPath());
}
D:\workspace\test\..\src\test1.txt
D:\workspace\src\test1.txt
public static void test3() throws Exception{
File file= new File("D:\\Text.txt");
System.out.println(file.getCanonicalPath());
}
(1),确定D盘下没有Text.txt这个文件,直接执行这段代码,得到的结果是:
D:\Text.txt注意这里试大写的Text.txt
(2)在D盘下建立一个文件,名叫text.txt,再次执行代码,得到结果
D:\text.txt同样的代码得到不同的结果。
四、英语before与after的用法
before与after的用法如下:
一、before的用法:
before可用于表示时间。首先,可以表示“先于,在…以前”,其后可以跟表示具体日期、时间等的名词或数词,也可以跟表示时间或动作的名词。其次,可以表示“在做…之前”,后接 v-ing。再次,可以表示“紧接在…之前”。
before用于否定句还可表示“直到…为止”。注before之后只能接表示时间点的名词,而不能接表示时间段的名词。
before可用于表示动态或静态的位置,意思是“在…之前”,与behind相对。
before可用于表示顺序或排列上的“在…之前”或“居于…之前”,与after相对。引申可用于表示比较,即在等级、价值、重要性、能力等方面的“在先”“优于”“重于”。再引申则可用于表示对某事物的优先选择,即“宁可”或“与其…宁可”。
二、after的用法:
after可用作连词连接一个时间状语从句,从句中一般用现在时表示将来。
after用作副词时常与soon, ever搭配,通常用于表示时间的名词后。
after用作副词时不用于比较等级。
after和in的使用:从某时说到多少时间以后,不用after,而用in。如果指“某个时刻,日期或事件以后”,用after。
扩展资料同义词:behind、below
一、behind英 [bɪˈhaɪnd]美 [bɪˈhaɪnd]
prep.在(或向)…的后面;在(或向)…的背面;落后于;支持;赞成
adv.在(或向)…的后面;在后面较远处;留在原地;拖欠;积压(工作)
n.义同bottom,委婉说法,即**
例句:Iputoneofthecushion**ehindhishead
我把其中的一个软垫垫在他脑后。
二、below英 [bɪˈləʊ]美 [bɪˈloʊ]
prep.在(或到)…下面;(数量)少于;(标准)低于;(级别、重要性)低于
adv.在(或到)下面;零度以下;下级
例句:Thepathrun**elowalongbrickwall
小道位于长砖墙脚下。
关于getPath()与getAbsolutePath()的区别的内容到此结束,希望对大家有所帮助。