-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain2.java
93 lines (70 loc) · 2.44 KB
/
Main2.java
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// public class Main2{
// public static void main(String args[]){
// StringBuffer s1="java";//creating StringBuffer by Java StringBuffer literal
// char ch[]={'s','t','r','i','n','g','s'};
// StringBuffer s2=new StringBuffer(ch);//converting char array to StringBuffer
// StringBuffer s3=new StringBuffer("example");//creating Java StringBuffer by new keyword
// System.out.println(s1);
// System.out.println(s2);
// System.out.println(s3);
// // count length
// System.out.println(s1.length());
// // concatenate StringBuffers
// System.out.println(s1 + s2);
// // gives the character at perticular index
// System.out.println(s2.charAt(3));
// // compare two StringBuffers
// System.out.println(s3.compareTo(s1));
// }}
// class Main2{
// //creating a default constructor
// Main2(){System.out.println("Bike is created");}
// //main method
// public static void main(String args[]){
// //calling a default constructor
// Main2 b=new Main2();
// }
// }
// //import java.util.Scanner;
// import java.io.*;
// // Class 1
// class main {
// // data members of the class.
// String name;
// int id;
// // Constructor would initialize data members
// // With the values of passed arguments while
// // Object of that class created
// main(String name, int id)
// {
// this.name = name;
// this.id = id;
// }
// }
// // Class 2
// class Main2 {
// // main driver method
// public static void main(String[] args)
// {
// // This would invoke the parameterized constructor.
// main user = new main("adam", 1);
// System.out.println("GeekName :" + user.name
// + " and GeekId :" + user.id);
// }
// }
// if(myNum[i]== 10){
// for ( ; i < myNum.length; i++)
// if(myNum[i]== 20){
// System.out.println("Yes");
// return ;
//
// int[] myNum = {10, 20, 30, 40};
// System.out.println("minutes: " + b);
// System.out.println("seconds: " + a);
// System.out.println("enter timr in seconds: ");
// System.out.println("enter float no. 2");
// float b =a/3600;
// a = a%3600;
// System.out.println("time :: \nhour: " + b);
// b =a/60;
// a = a%60;