-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectsLabs.java
More file actions
63 lines (51 loc) · 2.16 KB
/
ObjectsLabs.java
File metadata and controls
63 lines (51 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import java.util.Random;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author GameS
*/
public class ObjectsLabs {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String string1 = "Why";
String string2 = " choose ";
String string3 = " Northwest ";
String string4 = "among";
String string5 = " other ";
String string6 = " Universities ";
String string7 = string1.concat(string2).concat(string3).
concat(string4).concat(string5).concat(string6);
System.out.println("Length is :"+string7.length());
System.out.println(string1.trim()+" "+string2.trim()+" " + string3.trim()
+" " + string4.trim() + " " + string5.trim() + " "+string6.trim()
+ " ?");
String string8 = string7.substring(string7.indexOf("Universities"),
string7.indexOf("Universities") + string6.trim().length());
System.out.println(string8.indexOf("i"));
String string9 = "computer Applied science Applied Computer science "
+ "science Applied computer Appleid computer Science Applied "
+ "computer Applied";
System.out.println(string9.indexOf("Computer"));
System.out.println(string7.substring(string7.indexOf("Northwest"),
string7.indexOf("Northwest") + "Northwest".length()) + " is one "
+ string7.substring(string7.indexOf("among"),string7.indexOf("among")
+ "among".length()) + " the ");
System.out.println();
int value1 = 27,value2 = 4;
Math.pow(value1, value2);
double cosValue = Math.cos(value1);
System.out.println(1/cosValue);
double myNumber = 43.35;
Math.sqrt(myNumber);
int myNumber1 = 30 , myNumber2 = 60;
Random r = new Random();
System.out.println(r.nextInt(300));
}
}